P6323 [COCI 2006/2007 #4] ZBRKA

Description

Given a permutation of length $n$, find the number of permutations whose number of inversions is exactly $c$. Output the result modulo $10^9+7$.

Input Format

The input consists of one line with two integers $n, c$.

Output Format

Output the number of permutations whose number of inversions is exactly $c$. Output the result modulo $10^9+7$.

Explanation/Hint

#### Constraints For $100\%$ of the testdata, it is guaranteed that $1\le n\le 10^3$ and $1\le c\le 10^4$. #### Notes **This problem is translated from [COCI2006-2007](https://hsin.hr/coci/archive/2006_2007/) [CONTEST #4](https://hsin.hr/coci/archive/2006_2007/contest4_tasks.pdf) *T4 ZBRKA*** Translated by ChatGPT 5