#P6075. [JSOI2015] 子集选取

[JSOI2015] 子集选取

Description

Given a set S={1,2,,n}S = \left\{1,2,\cdots,n \right\} with nn elements and an integer kk, we want to choose some subsets Ai,j (AS, 1jik)A_{i,j}\ (A \subseteq S,\ 1 \le j \le i \le k) from SS and arrange them into a triangle with side length kk as shown below (so in total, 12k(k+1)\frac{1}{2} k(k+1) subsets are chosen).

$$\begin{matrix} A_{1,1}\\ A_{2,1}&A_{2,2}\\ A_{3,1}&A_{3,2}&A_{3,3}\\ \vdots&\vdots&\vdots&\ddots\\ A_{k,1}&A_{k,2}&A_{k,3}&\cdots&A_{k,k} \end{matrix}$$

In addition, JYY has extra requirements on the chosen subsets: these subsets must satisfy Ai,jAi,j1A_{i,j} \subseteq A_{i,j-1} and Ai,jAi1,jA_{i,j} \subseteq A_{i-1,j}.

JYY wants to know how many different ways there are to choose these subsets. Since the answer is very large, you only need to output the answer modulo 1,000,000,0071{,}000{,}000{,}007.

For two selection plans $A = \left\{ A_{1,1} , A_{2,1} ,\cdots, A_{k,k} \right\}$ and $B = \left\{ B_{1,1} , B_{2,1} ,\cdots, B_{k,k} \right\}$, as long as there exists some i,ji,j such that Ai,jBi,jA_{i,j} \neq B_{i,j}, we consider AA and BB to be different plans.

Input Format

The input contains one line with two integers nn and kk.

Output Format

Output one line with one integer, representing the number of different plans modulo 1,000,000,0071,000,000,007.

2 2
16

Hint

For 100%100\% of the testdata, 1n,k1091 \le n, k \le 10^9.

Translated by ChatGPT 5