#include using namespace std; #include using namespace atcoder; using mint=modint998244353; //1000000007; using ll=long long; using pp=pair; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n,k;cin>>n>>k; vc dp(k,vc(k,0)); vc ds(k,vc(k,0)); rep(i,k)rep(j,k)if(i!=j){ dp[i][j]=1; ds[i][j]=i+j; } rep(z,n-2){ vc pre(k,vc(k,0)); swap(pre,dp); vc pres(k,vc(k,0)); swap(pres,ds); vcup(k,0),down(k,0),ups(k,0),downs(k,0); rep(i,k)rep(j,k){ if(j>i)up[j]+=pre[i][j],ups[j]+=pres[i][j]; if(ji){ dp[i][j]=down[i]-pre[j][i]; ds[i][j]=downs[i]-pres[j][i]+dp[i][j]*j; } if(j