#P3321. 生成树Stcnt

生成树Stcnt

题目描述

<w:WordDocument>

<w:View>Normal</w:View>

<w:Zoom>0</w:Zoom>

<w:PunctuationKerning />

<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>

<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>

<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>

<w:ValidateAgainstSchemas />

<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>

<w:IgnoreMixedContent>false</w:IgnoreMixedContent>

<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>

<w:Compatibility>

<w:SpaceForUL />

<w:BalanceSingleByteDoubleByteWidth />

<w:DoNotLeaveBackslashAlone />

<w:ULTrailSpace />

<w:DoNotExpandShiftReturn />

<w:AdjustLineHeightInTable />

<w:BreakWrappedTables />

<w:SnapToGridInCell />

<w:WrapTextWithPunct />

<w:UseAsianBreakRules />

<w:DontGrowAutofit />

<w:UseFELayout />

</w:Compatibility>

<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>

</w:WordDocument>

<![endif]-->

</p>

 

<w:LatentStyles DefLockedState="false" LatentStyleCount="156">

</w:LatentStyles>

<![endif]--><!--[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

<![endif]-->

给定两个数 n; k ,求出满足条件的树的个数:

</p> <p style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1;

tab-stops:list 18.0pt" class="MsoNormal">1.<span style="font: 7pt "Times New Roman";">     </span> nk 个点,标号为 0; 1,…… nk

2.<span style="font: 7pt "Times New Roman";">     如果ij mod N,I,j间不存在边</span></p>

输入格式

 

一行两个数N,K

输出格式

一行一个数,表示答案Mod 10^9+7

 

2 2
4

数据范围与约定



N,K<=10^9