func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 7;   long long dp[21][2001];   long long fact[200001];   long long tcaf[200001];   int pow1(int n, int p) {     long long cur, res;     cur = n;     res = 1;     while (p) {       if (p & 1) {         res *= cur;         res %= MOD;       }       p /= 2;       cur *= cur;       cur %= MOD;     }     return res;   }   void init() {     fact[0] = tcaf[0] = 1;     for (int i = 1; i < 200001; i++) {       fact[i] = 1LL * fact[i - 1] * i % MOD;       tcaf[i] = pow1(fact[i], MOD - 2);     }   }   int ways(pair<int, int> p1, pair<int, int> p2) {     int n, m;     n = p2.first - p1.first;     m = p2.second - p1.second;     if (n < 0 || m < 0) return 0;     return 1LL * fact[n + m] * tcaf[n] % MOD * tcaf[m] % MOD;   }   long long calc(int s, int num, int tot) {     for (int i = 0; i < num; i++) s = (s + 1) / 2;     return 1LL * tot * s;   }   int main() {     init();     int n, m, k, s;     cin >> n >> m >> k >> s;     init();     vector<pair<int, int>> points(k + 1);     for (int i = 1; i <= k; i++) {       scanf( %d %d , &points[i].first, &points[i].second);       points[i].first--;       points[i].second--;     }     points.push_back({n - 1, m - 1});     sort(points.begin(), points.end());     dp[0][0] = 1;     for (int i = 1; i <= k + 1; i++) {       dp[0][i] = ways({0, 0}, points[i]);       for (int j = 1; j < i; j++) {         dp[0][i] -= 1LL * dp[0][j] * ways(points[j], points[i]), dp[0][i] %= MOD;       }     }     for (int i = 1; i <= 20; i++) {       for (int j = 1; j <= k + 1; j++) {         dp[i][j] = ways({0, 0}, points[j]);         for (int s = 1; s < j; s++) {           dp[i][j] -= 1LL * dp[i][s] * ways(points[s], points[j]) % MOD;           dp[i][j] %= MOD;         }         for (int s = i - 1; s >= 0; s--) dp[i][j] -= dp[s][j], dp[i][j] %= MOD;       }     }     long long res = 0;     long long tot = ways({0, 0}, {n - 1, m - 1});     for (int i = 0; i <= 20; i++) {       res += calc(s, i, dp[i][k + 1]);       res %= MOD;       tot -= dp[i][k + 1];     }     res += tot;     res *= pow1(ways({0, 0}, {n - 1, m - 1}), MOD - 2);     res %= MOD;     res = (res + MOD) % MOD;     cout << res;     return 0;   }   