#include #include #include using namespace std; const int N = 1e3+10,mod = 998244353; typedef long long LL; LL f[N][N]; LL sum[N]; int main(){ int n,m; scanf("%d%d",&n,&m); f[1][0]=1; for(int i=2;i<=n;i++){ sum[0]=f[i-1][0]; for(int j=0;j<=m;j++){ sum[j]=(sum[j-1]+f[i-1][j])%mod; } for(int j=0;j<=m;j++){ int last=j-(i-1)-1; f[i][j]+=sum[j]; if(last>=0)f[i][j]=(f[i][j]-sum[last]+mod)%mod; f[i][j]%=mod; } } cout<