PERMS

No attempts yetTime limit1sMemory limit128 MB

Problem

A permutation of the integers $1, 2, 3, \ldots, n$ is an ordering $a_1, a_2, a_3, \ldots, a_n$ of those $n$ integers. An inversion is a pair $(a_i, a_j)$ with $i < j$ and $a_i > a_j$ — that is, a larger value appearing before a smaller one. The number of inversions in a permutation measures how "unsorted" it is, and it is often useful when analyzing the average running time of sorting algorithms.

Your task is to compute how many permutations of ${1, 2, \ldots, n}$ have exactly $k$ inversions.

For example, when $n = 3$ there are $6$ permutations, with inversion counts as shown below.

PermutationInversions
1230
1321 ($3 > 2$)
2131 ($2 > 1$)
2312 ($2 > 1$, $3 > 1$)
3122 ($3 > 1$, $3 > 2$)
3213 ($3 > 2$, $3 > 1$, $2 > 1$)

So among the permutations of $3$ elements, $1$ has $0$ inversions, $2$ have $1$ inversion, $2$ have $2$ inversions, $1$ has $3$ inversions, and none have $4$ or more.

Input

The input contains one or more queries, one per line. Each line gives two integers: $n$ ($1 \le n \le 18$) and a non-negative integer $k$ ($0 \le k \le 200$). The input ends with a line containing $n = k = 0$, which must not be processed.

Output

For each query, print on its own line the number of permutations of ${1, 2, \ldots, n}$ that have exactly $k$ inversions.