#P6323. [COCI 2006/2007 #4] ZBRKA
[COCI 2006/2007 #4] ZBRKA
Problem Description
Given a permutation of length , find the number of permutations whose number of inversions is exactly . Output the result modulo .
Input Format
The input consists of one line with two integers .
Output Format
Output the number of permutations whose number of inversions is exactly . Output the result modulo .
10 1
9
4 3
6
9 13
17957
Hint
Constraints
For of the testdata, it is guaranteed that and .
Notes
This problem is translated from COCI2006-2007 CONTEST #4 T4 ZBRKA
Translated by ChatGPT 5