/** author: shobonvip created: 2024.10.25 21:49:37 **/ #include using namespace std; //* ATCODER #include using namespace atcoder; typedef modint998244353 mint; //*/ /* BOOST MULTIPRECISION #include using namespace boost::multiprecision; //*/ typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) template bool chmin(T &a, const T &b) { if (a <= b) return false; a = b; return true; } template bool chmax(T &a, const T &b) { if (a >= b) return false; a = b; return true; } template T max(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]); return ret; } template T min(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]); return ret; } template T sum(vector &a){ T ret = 0; for (int i=0; i<(int)a.size(); i++) ret += a[i]; return ret; } //defmodfact const int COMinitMAX = 998244; mint fact[COMinitMAX+1], factinv[COMinitMAX+1]; void modfact(){ fact[0] = 1; for (int i=1; i<=COMinitMAX; i++){ fact[i] = fact[i-1] * i; } factinv[COMinitMAX] = fact[COMinitMAX].inv(); for (int i=COMinitMAX-1; i>=0; i--){ factinv[i] = factinv[i+1] * (i+1); } } mint binom(int a, int b){ if (a> n>>m>>k; vector dp(m+2, vector(m+1)); dp[0][0] = 1; rep(i,1,m+2){ rep(j,0,i){ rep(l,0,m+1){ if (l+i-j-1 > m) continue; if (min(i,k)-j >= 0){ dp[i][l+i-j-1] += dp[j][l] * mint(i).pow(min(i,k)-j); }else{ dp[i][l+i-j-1] += dp[j][l]; } } } } vector dp2(m+1); rep(i,0,m+1){ dp2[i] = mint(i).pow(n); rep(j,0,i){ dp2[i] -= binom(i,j) * dp2[j]; } } mint ans = 0; rep(i,1,m+1){ ans += dp[m+1][i] * dp2[i]; } cout << ans.val() << '\n'; }