1832Inversion Number

1832   Inversion Number

题目描述

Let { A1,A2,...,An } be a permutation of the set{ 1,2,..., n}. The inversion number of the permutation is the number of integer pairs (i,j) that satisfy 1<=i<j<=n and Ai>Aj.

Your task is to calculate how many n-permutations has an inversion number of k.

输入格式:

The input consists of several test cases. Each test case contains two integers n(0<n<=20) and k(0<=k<=200), which are mentioned above. Input is terminated by n=m=0, which should not be proceeded.

输出格式:

For each case of input output the number of n-permutations that has an inversion number of k in one line.

输入样例 复制
2 0
5 3
0 0
输出样例 复制
1
15

说明

2
7
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型基础强化
难        度