func_code_string: #include <bits/stdc++.h>   using namespace std;   long long P = 998244353;   double PI = 3.141592653589793;   const int sqr = 500;   const int arrn = 2e5 + 5;   const int arrn2 = 1e3 + 5;   long long inv[arrn] = {};   long long fac[arrn] = {};   void prefinv(int n, int p) {     inv[0] = 1;     inv[1] = 1;     fac[1] = 1;     fac[0] = 1;     for (int i = 2; i <= n; i++) {       fac[i] = fac[i - 1] * i;       fac[i] %= p;       inv[i] = (p - (((p / i) * inv[p % i]) % p)) % p;     }     for (int i = 2; i <= n; i++) {       inv[i] = inv[i] * inv[i - 1];       inv[i] %= p;       if (inv[i] < 0) inv[i] += p;     }   }   long long comb(int n, int r, int mod) {     if (n < r)       return 0;     else {       long long temp = fac[n];       temp *= inv[r];       temp %= mod;       temp *= inv[n - r];       temp %= mod;       return temp;     }   }   long long binpow(long long a, long long n, long long p) {     long long ret = 1;     while (n) {       if (n & 1) ret *= a;       ret %= p;       a *= a;       a %= p;       n /= 2;     }     return ret;   }   void solve() {     prefinv(arrn - 1, P);     int n;     long long k;     cin >> n >> k;     if (k > n - 1) {       cout << 0;       return;     }     long long out = 0;     for (int i = k; i < n; i++) {       if ((i - k) & 1) {         out = (out - ((comb(n - k, i - k, P) * binpow(n - i, n, P)) % P)) % P;       } else {         out = (out + ((comb(n - k, i - k, P) * binpow(n - i, n, P)) % P)) % P;       }     }     out = (out * comb(n, k, P)) % P;     if (k > 0) out *= 2;     out %= P;     cout << (out + P) % P;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     int T = 1;     for (int c = 0; c < T; c++) {       solve();     }   }   