func_code_string: #include <bits/stdc++.h>   template <class T>   T Min(const T &a, const T &b) {     return a < b ? a : b;   }   template <class T>   T Max(const T &a, const T &b) {     return a > b ? a : b;   }   template <class T>   bool Chkmin(T &a, const T &b) {     return a > b ? a = b, 1 : 0;   }   template <class T>   bool Chkmax(T &a, const T &b) {     return a < b ? a = b, 1 : 0;   }   struct fast_input {     static const int L = 1 << 15 | 1;     char buf[L], *l, *r;     fast_input() { l = r = buf; }     void Next(char &c) {       if (l == r) r = (l = buf) + fread(buf, 1, L, stdin);       c = l == r ? (char)EOF : *l++;     }     template <class T>     void operator()(T &x) {       char c, f = 0;       for (Next(c); !isdigit(c); Next(c))         if (c ==  - ) f = 1;       for (x = 0; isdigit(c); Next(c)) x = x * 10 + c -  0 ;       if (f) x = -x;     }   } input;   const int N = 1000 + 3;   const int M = 100000 + 7;   const int MOD = 998244353;   int n, m, a[N], f[N][N], ans[M], b[M];   int Power(int x, int y) {     int ret = 1;     while (y) {       if (y & 1) ret = 1LL * x * ret % MOD;       x = 1LL * x * x % MOD, y >>= 1;     }     return ret;   }   int main() {     int x, y, z;     input(n), input(m);     for (int i = (1), i_end = (n); i <= i_end; ++i) input(a[i]), b[a[i]] = 1;     std::sort(a + 1, a + n + 1);     ans[0] = 1;     for (int i = (m + 1), i_end = (n); i <= i_end; ++i)       ans[0] = 1LL * ans[0] * i % MOD;     for (int i = (2), i_end = (n - m); i <= i_end; ++i)       ans[0] = 1LL * ans[0] * Power(i, MOD - 2) % MOD;     int maxans = 0;     while (ans[maxans++]) {       x = 0;       for (int i = (1), i_end = (n); i <= i_end; ++i)         x |= (a[i] - maxans + 1 >= 0 && b[a[i] - maxans + 1]);       if (!x) {         ans[maxans] = ans[maxans - 1];         continue;       }       f[0][0] = 1, x = 0;       for (int j = (1), j_end = (n); j <= j_end; ++j) {         for (int k = (1), k_end = (m); k <= k_end; ++k) {           while (a[j] - a[x + 1] >= maxans) ++x;           f[j][k] = (f[j - 1][k] + f[x][k - 1]) % MOD;         }         f[j][0] = f[j - 1][0];       }       ans[maxans] = f[n][m];     }     int ret = 0;     for (int i = (1), i_end = (maxans - 2); i <= i_end; ++i)       ret = (ret + 1LL * (ans[i] - ans[i + 1]) * i) % MOD;     printf( %d n , (ret + MOD) % MOD);     return 0;   }   