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.

Input

Single line contains three integers N, M, K. 1 ≤ N ≤ 14, , 0 ≤ K ≤ N.

Output

One integer — number or permutations.

ExamplesInput
4 0 4
Output
1
Input
12 7 3
Output
3000
Input
12 25 0
Output
3612516
Input
12 66 0
Output
1

加入题单

上一题 下一题 算法标签: