D - ~K Perm Counting 解説 /

実行時間制限: 2 sec / メモリ制限: 256 MB

配点 : 900

問題文

すぬけ君は順列が大好きなので、長さ N の順列を作ることにしました。

ただしすぬけ君は整数 K が嫌いなので、以下の条件を満たす順列を作ることにしました。

  • 順列を a_1, a_2, ..., a_N とする。全ての i = 1,2,...,N について、|a_i - i| \neq K を満たす

長さ N の順列は N! 通りありますが、そのうち条件をみたすものは何個あるかを求めてください。

ただし答えは非常に大きくなることがあるので、答えを 924844033(素数) で割ったあまりを求めてください。

制約

  • 2 ≦ N ≦ 2000
  • 1 ≦ K ≦ N-1

入力

入力は以下の形式で標準入力から与えられる。

N K

出力

1 行に答えを 924844033 で割ったあまりを出力する。


入力例 1

3 1

出力例 1

2

(1, 2, 3), (3, 2, 1)2 つが条件を満たす。


入力例 2

4 1

出力例 2

5

(1, 2, 3, 4), (1, 4, 3, 2), (3, 2, 1, 4), (3, 4, 1, 2), (4, 2, 3, 1)5 つが条件を満たす。


入力例 3

4 2

出力例 3

9

入力例 4

4 3

出力例 4

14

入力例 5

425 48

出力例 5

756765083

Score : 900 points

Problem Statement

Snuke loves permutations. He is making a permutation of length N.

Since he hates the integer K, his permutation will satisfy the following:

  • Let the permutation be a_1, a_2, ..., a_N. For each i = 1,2,...,N, |a_i - i| \neq K.

Among the N! permutations of length N, how many satisfies this condition?

Since the answer may be extremely large, find the answer modulo 924844033(prime).

Constraints

  • 2 ≦ N ≦ 2000
  • 1 ≦ K ≦ N-1

Input

The input is given from Standard Input in the following format:

N K

Output

Print the answer modulo 924844033.


Sample Input 1

3 1

Sample Output 1

2

2 permutations (1, 2, 3), (3, 2, 1) satisfy the condition.


Sample Input 2

4 1

Sample Output 2

5

5 permutations (1, 2, 3, 4), (1, 4, 3, 2), (3, 2, 1, 4), (3, 4, 1, 2), (4, 2, 3, 1) satisfy the condition.


Sample Input 3

4 2

Sample Output 3

9

Sample Input 4

4 3

Sample Output 4

14

Sample Input 5

425 48

Sample Output 5

756765083