#P6323. Permutation Inversion Counts
Permutation Inversion Counts
Permutation Inversion Counts
You are given two integers n and c. Your task is to determine the number of permutations of the sequence \(\{1, 2, \ldots, n\}\) which have exactly \(c\) inversions. An inversion is defined as a pair of indices \((i, j)\) such that \(i a[j]\). Since the answer can be very large, output the result modulo \(10^9+7\).
inputFormat
The input consists of a single line containing two space-separated integers: n and c.
outputFormat
Output a single integer representing the number of valid permutations modulo \(10^9+7\).
sample
3 0
1