CF848D.Shake It!

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A never-ending, fast-changing and dream-like world unfolds, as the secret door opens.

A world is an unordered graph GG , in whose vertex set V(G)V(G) there are two special vertices s(G)s(G) and t(G)t(G) . An initial world has vertex set s(G),t(G){s(G),t(G)} and an edge between them.

A total of nn changes took place in an initial world. In each change, a new vertex ww is added into V(G)V(G) , an existing edge (u,v)(u,v) is chosen, and two edges (u,w)(u,w) and (v,w)(v,w) are added into E(G)E(G) . Note that it's possible that some edges are chosen in more than one change.

It's known that the capacity of the minimum ss - tt cut of the resulting graph is mm , that is, at least mm edges need to be removed in order to make s(G)s(G) and t(G)t(G) disconnected.

Count the number of non-similar worlds that can be built under the constraints, modulo 109+710^{9}+7 . We define two worlds similar, if they are isomorphic and there is isomorphism in which the ss and tt vertices are not relabelled. Formally, two worlds GG and HH are considered similar, if there is a bijection between their vertex sets , such that:

  • f(s(G))=s(H)f(s(G))=s(H) ;
  • f(t(G))=t(H)f(t(G))=t(H) ;
  • Two vertices uu and vv of GG are adjacent in GG if and only if f(u)f(u) and f(v)f(v) are adjacent in HH .

输入格式

The first and only line of input contains two space-separated integers nn , mm ( 1<=n,m<=501<=n,m<=50 ) — the number of operations performed and the minimum cut, respectively.

输出格式

Output one integer — the number of non-similar worlds that can be built, modulo 109+710^{9}+7 .

输入输出样例

  • 输入#1

    3 2
    

    输出#1

    6
    
  • 输入#2

    4 4
    

    输出#2

    3
    
  • 输入#3

    7 3
    

    输出#3

    1196
    
  • 输入#4

    31 8
    

    输出#4

    64921457
    

说明/提示

In the first example, the following 66 worlds are pairwise non-similar and satisfy the constraints, with s(G)s(G) marked in green, t(G)t(G) marked in blue, and one of their minimum cuts in light blue.

In the second example, the following 33 worlds satisfy the constraints.

首页