func_code_string: #include <bits/stdc++.h>   using namespace std;   using ll = long long;   const ll MOD = 998244353;   const ll MX = 3e5 + 5;   ll fct[MX] = {1}, inv[MX] = {1};   ll power(ll a, ll b, ll p = 1) {     if (b == 0) return 1;     ll res = power(a, b / 2) % MOD;     if (b & 1) {       return (((res * res) % MOD) * a) % MOD;     } else {       return (((res * res) % MOD) * 1) % MOD;     }   }   void func() {     ll i;     fct[1] = 1;     for (i = 2; i < MX; i++) {       fct[i] = fct[i - 1] * i;       fct[i] %= MOD;     }     for (i = 1; i < MX; i++) {       inv[i] = power(fct[i], MOD - 2);     }   }   int main() {     func();     ll n, i, k;     cin >> n >> k;     vector<pair<ll, ll>> vt;     for (i = 0; i < n; i++) {       ll l, r;       cin >> l >> r;       vt.push_back({l, -1});       vt.push_back({r, 1});     }     sort(vt.begin(), vt.end());     ll cur = 0, ans = 0;     for (i = 0; i < vt.size(); i++) {       if (vt[i].second < 0) {         cur++;       } else {         cur--;         if (cur >= k - 1)           ans += (((fct[cur] * inv[k - 1]) % MOD) * inv[cur - k + 1]) % MOD;         ans %= MOD;       }     }     cout << ans <<   n ;   }   