func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   long long fac[200001];   long long inv[200001];   long long modexp(long long b, long long e) {     long long ans = 1;     while (e > 0) {       if (e & 1) {         ans = (ans * b) % mod;       }       b = (b * b) % mod;       e >>= 1;     }     return ans;   }   long long comb(long long n, long long k) {     long long ans = (fac[n] * inv[k]) % mod;     ans = (ans * inv[n - k]) % mod;     return ans;   }   int main() {     fac[0] = fac[1] = 1;     inv[0] = inv[1] = 1;     for (int i = 2; i <= 200000; i++) {       fac[i] = (fac[i - 1] * i) % mod;       inv[i] = modexp(fac[i], mod - 2);     }     int n, k;     cin >> n >> k;     vector<pair<int, int> > list;     for (int i = 1; i <= n; i++) {       int a, b;       cin >> a >> b;       list.push_back(make_pair(a, 1));       list.push_back(make_pair(b + 1, -1));     }     sort(list.begin(), list.end());     int maintain = 0;     long long ans = 0;     int selisih;     for (int i = 0; i < list.size(); i++) {       if (i > 0 && list[i].first != list[i - 1].first) {         if (maintain >= k) {           ans += comb(maintain, k) * (list[i].first - selisih);           ans %= mod;         }       }       maintain += list[i].second;       selisih = list[i].first;     }     cout << ans << endl;   }   