#include using namespace std; #include using namespace atcoder; #define rep(i, n) for(int i=0;i<(n);++i) #define rep1(i, n) for(int i=1;i<=(n);i++) #define ll long long using mint = modint998244353; using P = pair; using lb = long double; using T = tuple; #ifdef LOCAL # include # define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else # define dbg(...) (static_cast(0)) #endif int main() { int n, k; cin >> n >> k; vector> dp(k+1, vector(n+1)); dp[0][0] = 1; rep(i,k){ for(int j=0;j<=n;j++){ if(j+1<=n){ dp[i+1][j+1] += dp[i][j]*(n-j); } if(j-1>=0){ dp[i+1][j-1] += dp[i][j]*j; } } } mint ans = 0; mint inv = mint(mint(n).pow(k)).inv(); for(int j=0;j<=n;j++){ if((k-j)%2 || k-j<0) continue; int cnt = (k-j)/2; dbg(j,cnt, dp[k][j].val()); ans += (n+cnt)*dp[k][j]*inv; } cout << ans.val() << endl; return 0; }