시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB38141346.429%

문제

A sequence x1, x2, ..., xn of different integers is called a permutation of size n if 1 ≤ xin for every 1 ≤ in. For every permutation we define its inversions as pairs of indices 1 ≤ i < jn such that xi > xj. Your task is to count the number of permutations of size n, having a given number of inversions.

Write a program which:

  • reads from the standard input the size of the permutation and the number of inversions,
  • counts the number of permutations of the given size and having the given number of inversions,
  • writes the result to the standard output.

입력

The first and only line of input contains two integers n and k (1 ≤ n ≤ 500, 0 ≤ kn(n - 1)/2), separated by a single space and representing the size of permutation and the number of inversions we are interested in.

출력

The first and only line of output should contain the remainder of the division of the number of the permutations we are interested in by 30 011.

예제 입력 1

3 2

예제 출력 1

2

힌트

The permutations of size 3 which have 2 inversions are 2, 3, 1 and 3, 1, 2.