stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <iostream>

using namespace std;



const int maxn = 2005;

const int P = 924844033;

int n, k, fact[maxn], dp[2][maxn][2][2];



void update(int &a, int b) {

	a += b;

	(a >= P) && (a -= P);

	(a < 0) && (a += P);

}



int main() {

	scanf("%d %d", &n, &k);

	fact[0] = 1;

	for (int i = 1; i <= 2000; i++) {

		fact[i] = 1ll * fact[i - 1] * i % P;

	}

 	int cur = 0, nxt = 1;

 	dp[0][0][1][0] = 1;

	for (int x = 1; x <= k; x++) {

		for (int j = x; j <= n; j += k) {

			memset(dp[nxt], 0, sizeof(dp[nxt]));

			for (int i = 0; i <= n; i++) {

				for (int v0 = 0; v0 < 2; v0++) {

					for (int v1 = 0; v1 < 2; v1++) {

						if (dp[cur][i][v0][v1]) {

							if (j + k > n) {

								update(dp[nxt][i][1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][1][0], dp[cur][i][v0][v1]);

								}

							} else {

								update(dp[nxt][i][v1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][v1][0], dp[cur][i][v0][v1]);

								}

								update(dp[nxt][i + 1][v1][1], dp[cur][i][v0][v1]);

							}

						}

					}

				}

			}

			swap(cur, nxt);

		}

	}

	int ans = 0;

	for (int i = 0; i <= n; i++) {

		int temp = 0;

		for (int v0 = 0; v0 < 2; v0++) {

			for (int v1 = 0; v1 < 2; v1++) {

				update(temp, dp[cur][i][v0][v1]);

			}

		}

		temp = 1ll * temp * fact[n - i] % P;

		if (i & 1) {

			update(ans, -temp);

		} else {

			update(ans, temp);

		}

	}

	printf("%d\n", ans);

	return 0;//

}

// Faster C++ solution for the same problem (measured speedup: 1.0522496879428618x):
#include<bits/stdc++.h>

using namespace std;

typedef long long LL;



const int N=2100,mod=924844033;

int n,K,cnt[N];

LL fac[N<<1],inv[N<<1],f[2][N],Ans;



LL qpow(LL x,int y)

{

	LL ret=1;

	while(y)

	{

		if(y&1) ret=ret*x%mod;

		x=x*x%mod, y>>=1;

	}

	return ret;

}



LL C(int x,int y)

{

	if(y>x) return 0;

	return fac[x]*inv[y]%mod*inv[x-y]%mod;

}



int main()

{

	scanf("%d%d",&n,&K);

	fac[0]=1;

	for(int i=1;i<=n<<1;++i) fac[i]=fac[i-1]*i%mod;

	inv[n<<1]=qpow(fac[n<<1],mod-2);

	for(int i=(n<<1)-1;i>=0;--i) inv[i]=inv[i+1]*(i+1)%mod;

	if(K*2>=n)

	{

		Ans=fac[n];

		for(int i=1;i<=(n-K)*2;++i)

			if(i&1) (Ans-=fac[n-i]*C((n-K)*2,i))%=mod;

			else (Ans+=fac[n-i]*C((n-K)*2,i))%=mod;

		(Ans+=mod)%=mod;

		printf("%lld",Ans); return 0;

	}

	for(int i=1;i<=K;++i) cnt[i]=(n-i-K)/(2*K)+1 + (n-i)/(2*K);

	f[0][0]=1;

	for(int i=1;i<=K;++i)

	{

		for(int j=0;j<=n;++j) f[1][j]=f[0][j];

		for(int j=0;j<=n;++j)

			for(int k=1;k<=min(j,cnt[i]);++k)

				(f[1][j]+=f[0][j-k]*C(cnt[i]-k+1,k)%mod)%=mod;

		for(int j=0;j<=n;++j) f[0][j]=f[1][j];

		for(int j=0;j<=n;++j)

			for(int k=1;k<=min(j,cnt[i]);++k)

				(f[0][j]+=f[1][j-k]*C(cnt[i]-k+1,k)%mod)%=mod;

	}

	Ans=fac[n];

	for(int i=1;i<=n;++i)

		if(i&1) (Ans-=f[0][i]*fac[n-i]%mod)%=mod;

		else (Ans+=f[0][i]*fac[n-i]%mod)%=mod;

	Ans=(Ans+mod)%mod;

	printf("%lld",Ans);

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <iostream>

using namespace std;



const int maxn = 2005;

const int P = 924844033;

int n, k, fact[maxn], dp[2][maxn][2][2];



void update(int &a, int b) {

	a += b;

	(a >= P) && (a -= P);

	(a < 0) && (a += P);

}



int main() {

	scanf("%d %d", &n, &k);

	fact[0] = 1;

	for (int i = 1; i <= 2000; i++) {

		fact[i] = 1ll * fact[i - 1] * i % P;

	}

 	int cur = 0, nxt = 1;

 	dp[0][0][1][0] = 1;

	for (int x = 1; x <= k; x++) {

		for (int j = x; j <= n; j += k) {

			memset(dp[nxt], 0, sizeof(dp[nxt]));

			for (int i = 0; i <= n; i++) {

				for (int v0 = 0; v0 < 2; v0++) {

					for (int v1 = 0; v1 < 2; v1++) {

						if (dp[cur][i][v0][v1]) {

							if (j + k > n) {

								update(dp[nxt][i][1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][1][0], dp[cur][i][v0][v1]);

								}

							} else {

								update(dp[nxt][i][v1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][v1][0], dp[cur][i][v0][v1]);

								}

								update(dp[nxt][i + 1][v1][1], dp[cur][i][v0][v1]);

							}

						}

					}

				}

			}

			swap(cur, nxt);

		}

	}

	int ans = 0;

	for (int i = 0; i <= n; i++) {

		int temp = 0;

		for (int v0 = 0; v0 < 2; v0++) {

			for (int v1 = 0; v1 < 2; v1++) {

				update(temp, dp[cur][i][v0][v1]);

			}

		}

		temp = 1ll * temp * fact[n - i] % P;

		if (i & 1) {

			update(ans, -temp);

		} else {

			update(ans, temp);

		}

	}

	printf("%d\n", ans);

	return 0;//

}

// Faster C++ solution for the same problem (measured speedup: 2.1663334585178706x):
#include<cstdio>

typedef long long LL;

const int MOD=924844033;

const int N=2003;



int n,k,cnt,ans;

int f[2*N][N][2];

int g[N],A[2*N],jc[N];



int main() {

	scanf("%d %d",&n,&k);

	jc[0]=1;

	for(LL i=1;i<=n;i++)

		jc[i]=i*jc[i-1]%MOD;

	for(int i=1;i<=k;i++) {

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

	}//加入链 

	f[0][0][0]=1;

	for(int i=1;i<=(n<<1);i++)

		for(int j=0;j<=i&&j<=n;j++) {

			f[i][j][0]=(f[i-1][j][0]+f[i-1][j][1])%MOD;

			if(!A[i]&&j) f[i][j][1]=f[i-1][j-1][0];

		}

	for(int i=0;i<=n;i++)

		g[i]=(f[n<<1][i][0]+f[n<<1][i][1])%MOD;

	for(LL i=0,o=1;i<=n;i++,o=-o)

		ans=(ans+o*g[i]*jc[n-i])%MOD;

	printf("%d\n",(ans+MOD)%MOD);

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<cmath>

#define mo  924844033

using namespace std;

typedef long long ll;

int n,k;

ll dp[2][2009][2][2],bin[2009];

int main()

{

  scanf("%d%d",&n,&k);

  dp[0][0][1][0]=1ll;

  int las=0,now=0;

  bin[0]=1;

  for (int i=1;i<=n;i++) bin[i]=(bin[i-1]*(ll)i)%mo;

  for (int t=1;t<=k;t++)

  {

    for (int i=t;i<=n;i+=k)

    {   

      las=now;now=now^1;

      for (int j=0;j<=n;j++)

      for (int x=0;x<=1;x++)

      for (int y=0;y<=1;y++)

      dp[now][j][x][y]=0;

    

      for (int j=0;j<=n;j++)

      for (int x=0;x<=1;x++)

      for (int y=0;y<=1;y++)

  	  {

  	    if (dp[las][j][x][y]==0) continue;

	    ll val=dp[las][j][x][y];

	    if (i+k>n)

	    {

	       dp[now][j][1][0]=(dp[now][j][1][0]+val)%mo;

		   if (x==0) dp[now][j+1][1][0]=(dp[now][j+1][1][0]+val)%mo;  

		}

		else 

		{

	      dp[now][j][y][0]=(dp[now][j][y][0]+val)%mo; 

	      if (x==0) dp[now][j+1][y][0]=(dp[now][j+1][y][0]+val)%mo;

	      dp[now][j+1][y][1]=(dp[now][j+1][y][1]+val)%mo;

	    }

      }

    }

  }

  ll ans=0;

  for (int i=0;i<=n;i++)

  {

  	ll sum=0;

  	for (int x=0;x<=1;x++)

  	for (int y=0;y<=1;y++)

  	sum=(sum+dp[now][i][x][y])%mo;

  	sum=(bin[n-i]*sum)%mo;

  	if (i%2==0) ans=(ans+sum)%mo;

  	else ans=(ans-sum)%mo;

  }

  ans=(ans+mo)%mo;

  printf("%lld\n",ans);

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8594247904554146x):
#include<cstdio>

typedef long long LL;

const int MOD=924844033;

const int N=2003;



int n,k,cnt,ans;

int f[2*N][N][2];

int g[N],A[2*N],jc[N];



int main() {

	scanf("%d %d",&n,&k);

	jc[0]=1;

	for(LL i=1;i<=n;i++)

		jc[i]=i*jc[i-1]%MOD;

	for(int i=1;i<=k;i++) {

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

	}//加入链 

	f[0][0][0]=1;

	for(int i=1;i<=(n<<1);i++)

		for(int j=0;j<=i&&j<=n;j++) {

			f[i][j][0]=(f[i-1][j][0]+f[i-1][j][1])%MOD;

			if(!A[i]&&j) f[i][j][1]=f[i-1][j-1][0];

		}

	for(int i=0;i<=n;i++)

		g[i]=(f[n<<1][i][0]+f[n<<1][i][1])%MOD;

	for(LL i=0,o=1;i<=n;i++,o=-o)

		ans=(ans+o*g[i]*jc[n-i])%MOD;

	printf("%d\n",(ans+MOD)%MOD);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

const int N = 2000 + 10;

const int P = 924844033;

int n, k, dp[N << 1][N][2], a[N << 1], num, fac[N];

int main() {

    scanf("%d%d", &n, &k);

    for (int i = fac[0] = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % P;

    for (int i = 1; i <= k; i++) {

        for (int j = i; j <= n; j += k) a[++num] = j;

        for (int j = i; j <= n; j += k) a[++num] = j;

    }

    dp[1][0][0] = 1;

    for (int i = 2; i <= (n << 1); i++) {

        for (int j = 0; j <= (i / 2); j++) {

            dp[i][j][0] = (dp[i - 1][j][0] + dp[i - 1][j][1]) % P;

            if (j && a[i] - a[i - 1] == k) dp[i][j][1] = dp[i - 1][j - 1][0];

        }

    }

    int ans = 0;

    for (int i = 0; i <= n; i++) {

        int g = (dp[n << 1][i][0] + dp[n << 1][i][1]) % P;

        if (i & 1)

            ans = (ans - 1ll * fac[n - i] * g % P + P) % P;

        else

            ans = (ans + 1ll * fac[n - i] * g) % P;

    }

    printf("%d\n", ans);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.3446253304798716x):
#include<cstdio>

typedef long long LL;

const int MOD=924844033;

const int N=2003;



int n,k,cnt,ans;

int f[2*N][N][2];

int g[N],A[2*N],jc[N];



int main() {

	scanf("%d %d",&n,&k);

	jc[0]=1;

	for(LL i=1;i<=n;i++)

		jc[i]=i*jc[i-1]%MOD;

	for(int i=1;i<=k;i++) {

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

	}//加入链 

	f[0][0][0]=1;

	for(int i=1;i<=(n<<1);i++)

		for(int j=0;j<=i&&j<=n;j++) {

			f[i][j][0]=(f[i-1][j][0]+f[i-1][j][1])%MOD;

			if(!A[i]&&j) f[i][j][1]=f[i-1][j-1][0];

		}

	for(int i=0;i<=n;i++)

		g[i]=(f[n<<1][i][0]+f[n<<1][i][1])%MOD;

	for(LL i=0,o=1;i<=n;i++,o=-o)

		ans=(ans+o*g[i]*jc[n-i])%MOD;

	printf("%d\n",(ans+MOD)%MOD);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <sstream>

#include <algorithm>

#include <cstdio>

#include <cmath>

#include <set>

#include <map>

#include <queue>

#include <string>

#include <cstring>

#include <bitset>

#include <functional>

#include <random>

#define REP(i,a,n) for(int i=a;i<=n;++i)

#define PER(i,a,n) for(int i=n;i>=a;--i)

#define hr putchar(10)

#define pb push_back

#define lc (o<<1)

#define rc (lc|1)

#define mid ((l+r)>>1)

#define ls lc,l,mid

#define rs rc,mid+1,r

#define x first

#define y second

#define io std::ios::sync_with_stdio(false)

#define endl '\n'

#define DB(a) ({REP(__i,1,n) cout<<a[__i]<<',';hr;})

using namespace std;

typedef long long ll;

const int N = 1e4+10, P = 924844033, G = 5, Gi = 554906420;

ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}

ll qpow(ll a,ll n) {ll r=1%P;for (a%=P;n;a=a*a%P,n>>=1)if(n&1)r=r*a%P;return r;}

ll inv(ll x){return x<=1?1:inv(P%x)*(P-P/x)%P;}



int lim,l,A[N],B[N],R[N];

void init(int n) {

    for (lim=1,l=0; lim<=n; lim<<=1,++l) ;

    REP(i,0,lim-1) R[i]=(R[i>>1]>>1)|((i&1)<<(l-1));

}



void NTT(int *J, int tp=1) {

    REP(i,0,lim-1) if (i<R[i]) swap(J[i],J[R[i]]);

    for (int j=1; j<lim; j<<=1) {

        ll T = qpow(tp==1?G:Gi,(P-1)/(j<<1));

        for (int k=0; k<lim; k+=j<<1) {

            ll t = 1;

            for (int l=0; l<j; ++l,t=t*T%P) {

                int y = t*J[k+j+l]%P;

                J[k+j+l] = (J[k+l]-y)%P;

                J[k+l] = (J[k+l]+y)%P;

            }

        }

    }

    if (tp==-1) {

        ll inv = qpow(lim, P-2);

        REP(i,0,lim-1) J[i]=(ll)inv*J[i]%P;

    }

}



int n,k,fac[N],ifac[N],a[N],b[N];

int C(int n, int m) {

	if (m>n) return 0;

	return (ll)fac[n]*ifac[m]%P*ifac[n-m]%P;

}



int main() {

	fac[0] = 1;

	REP(i,1,N-1) fac[i] = (ll)fac[i-1]*i%P;

	ifac[N-1] = inv(fac[N-1]);

	PER(i,0,N-2) ifac[i]=(ll)ifac[i+1]*(i+1)%P;

	scanf("%d%d", &n, &k);

	REP(i,0,n) a[i]=C(n/k-i,i),b[i]=C(n/k+1-i,i);

	init(2*n+2);

	NTT(a),NTT(b);

	REP(i,0,lim-1) a[i]=qpow(a[i],(k-n%k)*2)*qpow(b[i],n%k*2)%P;

	NTT(a,-1);

	int ans = 0;

	REP(i,0,n) {

		if (i&1) ans=(ans-(ll)a[i]*fac[n-i])%P;

		else ans=(ans+(ll)a[i]*fac[n-i])%P;

	}

	if (ans<0) ans += P;

	printf("%d\n", ans);

}














// Faster C++ solution for the same problem (measured speedup: 1.033213576642146x):
#include<cstdio>

typedef long long LL;

const int MOD=924844033;

const int N=2003;



int n,k,cnt,ans;

int f[2*N][N][2];

int g[N],A[2*N],jc[N];



int main() {

	scanf("%d %d",&n,&k);

	jc[0]=1;

	for(LL i=1;i<=n;i++)

		jc[i]=i*jc[i-1]%MOD;

	for(int i=1;i<=k;i++) {

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

	}//加入链 

	f[0][0][0]=1;

	for(int i=1;i<=(n<<1);i++)

		for(int j=0;j<=i&&j<=n;j++) {

			f[i][j][0]=(f[i-1][j][0]+f[i-1][j][1])%MOD;

			if(!A[i]&&j) f[i][j][1]=f[i-1][j-1][0];

		}

	for(int i=0;i<=n;i++)

		g[i]=(f[n<<1][i][0]+f[n<<1][i][1])%MOD;

	for(LL i=0,o=1;i<=n;i++,o=-o)

		ans=(ans+o*g[i]*jc[n-i])%MOD;

	printf("%d\n",(ans+MOD)%MOD);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long LL;



const int N=2100,mod=924844033;

int n,K,cnt[N];

LL fac[N<<1],inv[N<<1],f[2][N],Ans;



LL qpow(LL x,int y)

{

	LL ret=1;

	while(y)

	{

		if(y&1) ret=ret*x%mod;

		x=x*x%mod, y>>=1;

	}

	return ret;

}



LL C(int x,int y)

{

	if(y>x) return 0;

	return fac[x]*inv[y]%mod*inv[x-y]%mod;

}



int main()

{

	scanf("%d%d",&n,&K);

	fac[0]=1;

	for(int i=1;i<=n<<1;++i) fac[i]=fac[i-1]*i%mod;

	inv[n<<1]=qpow(fac[n<<1],mod-2);

	for(int i=(n<<1)-1;i>=0;--i) inv[i]=inv[i+1]*(i+1)%mod;

	if(K*2>=n)

	{

		Ans=fac[n];

		for(int i=1;i<=(n-K)*2;++i)

			if(i&1) (Ans-=fac[n-i]*C((n-K)*2,i))%=mod;

			else (Ans+=fac[n-i]*C((n-K)*2,i))%=mod;

		(Ans+=mod)%=mod;

		printf("%lld",Ans); return 0;

	}

	for(int i=1;i<=K;++i) cnt[i]=(n-i-K)/(2*K)+1 + (n-i)/(2*K);

	f[0][0]=1;

	for(int i=1;i<=K;++i)

	{

		for(int j=0;j<=n;++j) f[1][j]=f[0][j];

		for(int j=0;j<=n;++j)

			for(int k=1;k<=min(j,cnt[i]);++k)

				(f[1][j]+=f[0][j-k]*C(cnt[i]-k+1,k)%mod)%=mod;

		for(int j=0;j<=n;++j) f[0][j]=f[1][j];

		for(int j=0;j<=n;++j)

			for(int k=1;k<=min(j,cnt[i]);++k)

				(f[0][j]+=f[1][j-k]*C(cnt[i]-k+1,k)%mod)%=mod;

	}

	Ans=fac[n];

	for(int i=1;i<=n;++i)

		if(i&1) (Ans-=f[0][i]*fac[n-i]%mod)%=mod;

		else (Ans+=f[0][i]*fac[n-i]%mod)%=mod;

	Ans=(Ans+mod)%mod;

	printf("%lld",Ans);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.058763697761728x):
#include<cstdio>

typedef long long LL;

const int MOD=924844033;

const int N=2003;



int n,k,cnt,ans;

int f[2*N][N][2];

int g[N],A[2*N],jc[N];



int main() {

	scanf("%d %d",&n,&k);

	jc[0]=1;

	for(LL i=1;i<=n;i++)

		jc[i]=i*jc[i-1]%MOD;

	for(int i=1;i<=k;i++) {

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

		for(int j=i;j<=n;j+=k) A[++cnt]=(i==j);

	}//加入链 

	f[0][0][0]=1;

	for(int i=1;i<=(n<<1);i++)

		for(int j=0;j<=i&&j<=n;j++) {

			f[i][j][0]=(f[i-1][j][0]+f[i-1][j][1])%MOD;

			if(!A[i]&&j) f[i][j][1]=f[i-1][j-1][0];

		}

	for(int i=0;i<=n;i++)

		g[i]=(f[n<<1][i][0]+f[n<<1][i][1])%MOD;

	for(LL i=0,o=1;i<=n;i++,o=-o)

		ans=(ans+o*g[i]*jc[n-i])%MOD;

	printf("%d\n",(ans+MOD)%MOD);

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <cstring>

#include <iostream>

using namespace std;



const int maxn = 2005;

const int P = 924844033;

int n, k, fact[maxn], dp[2][maxn][2][2];



void update(int &a, int b) {

	a += b;

	(a >= P) && (a -= P);

	(a < 0) && (a += P);

}



int main() {

	scanf("%d %d", &n, &k);

	fact[0] = 1;

	for (int i = 1; i <= 2000; i++) {

		fact[i] = 1ll * fact[i - 1] * i % P;

	}

 	int cur = 0, nxt = 1;

 	dp[0][0][1][0] = 1;

	for (int x = 1; x <= k; x++) {

		for (int j = x; j <= n; j += k) {

			memset(dp[nxt], 0, sizeof(dp[nxt]));

			for (int i = 0; i <= n; i++) {

				for (int v0 = 0; v0 < 2; v0++) {

					for (int v1 = 0; v1 < 2; v1++) {

						if (dp[cur][i][v0][v1]) {

							if (j + k > n) {

								update(dp[nxt][i][1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][1][0], dp[cur][i][v0][v1]);

								}

							} else {

								update(dp[nxt][i][v1][0], dp[cur][i][v0][v1]);

								if (v0 == 0) {

									update(dp[nxt][i + 1][v1][0], dp[cur][i][v0][v1]);

								}

								update(dp[nxt][i + 1][v1][1], dp[cur][i][v0][v1]);

							}

						}

					}

				}

			}

			swap(cur, nxt);

		}

	}

	int ans = 0;

	for (int i = 0; i <= n; i++) {

		int temp = 0;

		for (int v0 = 0; v0 < 2; v0++) {

			for (int v1 = 0; v1 < 2; v1++) {

				update(temp, dp[cur][i][v0][v1]);

			}

		}

		temp = 1ll * temp * fact[n - i] % P;

		if (i & 1) {

			update(ans, -temp);

		} else {

			update(ans, temp);

		}

	}

	printf("%d\n", ans);

	return 0;//

}

// Faster C++ solution for the same problem (measured speedup: 4.362812179205643x):
#include<cstdio>

#define N 2002

#define p 924844033

inline int mod(int x){return x<p?x:x-p;}

int a[N],f[N][2],i,j,m,n,s,x;

int main()

{

	scanf("%d%d",&n,&m),f[0][0]=1;

	for(i=1;i<=m;i++)

	{

		for(j=0;j<=n;f[j++][0]=0)f[j][1]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(;i<=n&&i<=m<<1;i++)

	{

		for(j=0;j<=n;f[j++][1]=0)f[j][0]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(i=*a=1;i<=n;i++)a[i]=(long long)a[i-1]*i%p;

	for(i=0;i<=n;i++)x=i&1?(x+(long long)(p-a[n-i])*(f[i][0]+f[i][1]))%p:(x+(long long)a[n-i]*(f[i][0]+f[i][1]))%p;

	return 0&printf("%d\n",x);

}
// Slower C++ solution:
#include<iostream>

#include<cstring>

#include<cstdio>

#include<cstdlib>

#include<algorithm>

#include<cmath>

#define mo  924844033

using namespace std;

typedef long long ll;

int n,k;

ll dp[2][2009][2][2],bin[2009];

int main()

{

  scanf("%d%d",&n,&k);

  dp[0][0][1][0]=1ll;

  int las=0,now=0;

  bin[0]=1;

  for (int i=1;i<=n;i++) bin[i]=(bin[i-1]*(ll)i)%mo;

  for (int t=1;t<=k;t++)

  {

    for (int i=t;i<=n;i+=k)

    {   

      las=now;now=now^1;

      for (int j=0;j<=n;j++)

      for (int x=0;x<=1;x++)

      for (int y=0;y<=1;y++)

      dp[now][j][x][y]=0;

    

      for (int j=0;j<=n;j++)

      for (int x=0;x<=1;x++)

      for (int y=0;y<=1;y++)

  	  {

  	    if (dp[las][j][x][y]==0) continue;

	    ll val=dp[las][j][x][y];

	    if (i+k>n)

	    {

	       dp[now][j][1][0]=(dp[now][j][1][0]+val)%mo;

		   if (x==0) dp[now][j+1][1][0]=(dp[now][j+1][1][0]+val)%mo;  

		}

		else 

		{

	      dp[now][j][y][0]=(dp[now][j][y][0]+val)%mo; 

	      if (x==0) dp[now][j+1][y][0]=(dp[now][j+1][y][0]+val)%mo;

	      dp[now][j+1][y][1]=(dp[now][j+1][y][1]+val)%mo;

	    }

      }

    }

  }

  ll ans=0;

  for (int i=0;i<=n;i++)

  {

  	ll sum=0;

  	for (int x=0;x<=1;x++)

  	for (int y=0;y<=1;y++)

  	sum=(sum+dp[now][i][x][y])%mo;

  	sum=(bin[n-i]*sum)%mo;

  	if (i%2==0) ans=(ans+sum)%mo;

  	else ans=(ans-sum)%mo;

  }

  ans=(ans+mo)%mo;

  printf("%lld\n",ans);

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.7447241052473745x):
#include<cstdio>

#define N 2002

#define p 924844033

inline int mod(int x){return x<p?x:x-p;}

int a[N],f[N][2],i,j,m,n,s,x;

int main()

{

	scanf("%d%d",&n,&m),f[0][0]=1;

	for(i=1;i<=m;i++)

	{

		for(j=0;j<=n;f[j++][0]=0)f[j][1]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(;i<=n&&i<=m<<1;i++)

	{

		for(j=0;j<=n;f[j++][1]=0)f[j][0]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(i=*a=1;i<=n;i++)a[i]=(long long)a[i-1]*i%p;

	for(i=0;i<=n;i++)x=i&1?(x+(long long)(p-a[n-i])*(f[i][0]+f[i][1]))%p:(x+(long long)a[n-i]*(f[i][0]+f[i][1]))%p;

	return 0&printf("%d\n",x);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

const int N = 2000 + 10;

const int P = 924844033;

int n, k, dp[N << 1][N][2], a[N << 1], num, fac[N];

int main() {

    scanf("%d%d", &n, &k);

    for (int i = fac[0] = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % P;

    for (int i = 1; i <= k; i++) {

        for (int j = i; j <= n; j += k) a[++num] = j;

        for (int j = i; j <= n; j += k) a[++num] = j;

    }

    dp[1][0][0] = 1;

    for (int i = 2; i <= (n << 1); i++) {

        for (int j = 0; j <= (i / 2); j++) {

            dp[i][j][0] = (dp[i - 1][j][0] + dp[i - 1][j][1]) % P;

            if (j && a[i] - a[i - 1] == k) dp[i][j][1] = dp[i - 1][j - 1][0];

        }

    }

    int ans = 0;

    for (int i = 0; i <= n; i++) {

        int g = (dp[n << 1][i][0] + dp[n << 1][i][1]) % P;

        if (i & 1)

            ans = (ans - 1ll * fac[n - i] * g % P + P) % P;

        else

            ans = (ans + 1ll * fac[n - i] * g) % P;

    }

    printf("%d\n", ans);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.765074732455879x):
#include<cstdio>

#define N 2002

#define p 924844033

inline int mod(int x){return x<p?x:x-p;}

int a[N],f[N][2],i,j,m,n,s,x;

int main()

{

	scanf("%d%d",&n,&m),f[0][0]=1;

	for(i=1;i<=m;i++)

	{

		for(j=0;j<=n;f[j++][0]=0)f[j][1]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(;i<=n&&i<=m<<1;i++)

	{

		for(j=0;j<=n;f[j++][1]=0)f[j][0]=mod(f[j][0]+f[j][1]);

		for(s=(n-i)/m+2>>1;s--;)

		for(j=n;j--;)

		{

			f[j+1][0]=mod(f[j+1][0]+f[j][0]);

			f[j+1][1]=mod(f[j+1][1]+mod(f[j][0]+f[j][1]));

			f[j][0]=mod(f[j][0]+f[j][1]);

			f[j][1]=0;

		}

		if(~((n-i)/m)&1)for(j=0;j<=n;j++)f[j][1]=0;

	}

	for(i=*a=1;i<=n;i++)a[i]=(long long)a[i-1]*i%p;

	for(i=0;i<=n;i++)x=i&1?(x+(long long)(p-a[n-i])*(f[i][0]+f[i][1]))%p:(x+(long long)a[n-i]*(f[i][0]+f[i][1]))%p;

	return 0&printf("%d\n",x);

}