Problem:
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

Solution in Rust (1.15.1) (judge verdict: Accepted)

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        k: usize
    }
    let d = 924844033;
    let mut dp: Vec<Vec<usize>> = vec![vec![0; 2]; n + 1];
    dp[0][1] = 1;
    for _ in 0..2 * (k - n % k) {
        for _ in 0..n / k - 1 {
            let mut next = vec![vec![0; 2]; n + 1];
            next[0][1] = 1;
            for j in 0..n {
                next[j + 1][0] = dp[j][1];
                next[j + 1][1] = (dp[j + 1][0] + dp[j + 1][1]) % d;
            }
            dp = next;
        }
        for j in 0..n + 1 {
            dp[j][1] = (dp[j][0] + dp[j][1]) % d;
            dp[j][0] = 0;
        }
    }
    for _ in 0..2 * (n % k) {
        for _ in 0..n / k {
            let mut next = vec![vec![0; 2]; n + 1];
            next[0][1] = 1;
            for j in 0..n {
                next[j + 1][0] = dp[j][1];
                next[j + 1][1] = (dp[j + 1][0] + dp[j + 1][1]) % d;
            }
            dp = next;
        }
        for j in 0..n + 1 {
            dp[j][1] = (dp[j][0] + dp[j][1]) % d;
            dp[j][0] = 0;
        }
    }
    let mut st = vec![1; n + 1];
    for i in 1..n + 1 {
        st[i] = st[i - 1] * i % d;
    }
    let mut ans = 0;
    for i in 0..n + 1 {
        if i % 2 == 1 {
            ans = (ans + d - st[n - i] * dp[i][1] % d) % d;
        } else {
            ans = (ans + st[n - i] * dp[i][1]) % d;
        }
    }
    println!("{}", ans);
}