AtCoder Grand Contest 005
翻译中…
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$.
翻译中…
样例
Input #1
3 1
Output #1
2
$2$ permutations $(1, 2, 3)$, $(3, 2, 1)$ satisfy the condition.
Input #2
4 1
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.
Input #3
4 2
Output #3
9
Input #4
4 3
Output #4
14
Input #5
425 48
Output #5
756765083
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。