func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long int mx = 2e3 + 1, Mod = 1e9 + 7;   long long int k, Pa, Pb;   int pw(long long int a, int b) {     long long int ans = 1;     while (b) {       if (b % 2) ans = (ans * a) % Mod;       a = (a * a) % Mod;       b /= 2;     }     return ans;   }   long long int dp[mx][mx];   long long int dpp(int i, int j) {     if (j >= k) return j;     return dp[i][j];   }   int main() {     ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);     cin >> k >> Pa >> Pb;     long long int divm = pw(Pa + Pb, Mod - 2);     long long int divb = (Pa * pw(Pb, Mod - 2)) % Mod;     for (int i = k; i >= 0; i--)       for (int j = k - 1; j >= 0; j--) {         if (i == k) {           dp[i][j] = (i + j + divb) % Mod;           continue;         }         dp[i][j] =             (((Pa * dpp(i + 1, j) + Pb * dpp(i, i + j)) % Mod) * divm) % Mod;       }     return cout << dp[1][0], 0;   }   