402663: GYM100834 L Polycarp and Permutations
Memory Limit:512 MB
Time Limit:3 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
L. Polycarp and Permutationstime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output
Polycarp has set of integers 1, ..., N and parameters M и K. Polycarp is interested in number of permutations {ai} from numbers 1, ..., N, so that every permutation have exactly M inversions and K numbers are in their own place. Inversion is the pair of numbers i, j, so that ai > aj и i < j. Number i is postioned in it's own place if ai = i.
InputSingle line contains three integers N, M, K. 1 ≤ N ≤ 14, , 0 ≤ K ≤ N.
OutputOne integer — number or permutations.
ExamplesInput4 0 4Output
1Input
12 7 3Output
3000Input
12 25 0Output
3612516Input
12 66 0Output
1