#P6323. [COCI 2006/2007 #4] ZBRKA

[COCI 2006/2007 #4] ZBRKA

Problem Description

Given a permutation of length nn, find the number of permutations whose number of inversions is exactly cc. Output the result modulo 109+710^9+7.

Input Format

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

Output Format

Output the number of permutations whose number of inversions is exactly cc. Output the result modulo 109+710^9+7.

10 1
9
4 3
6
9 13
17957

Hint

Constraints

For 100%100\% of the testdata, it is guaranteed that 1n1031\le n\le 10^3 and 1c1041\le c\le 10^4.

Notes

This problem is translated from COCI2006-2007 CONTEST #4 T4 ZBRKA

Translated by ChatGPT 5