func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1005;   int k;   long long pa, pb;   long long A, B, C;   long long f[N][N];   void exgcd(int a, int b, long long &x, long long &y) {     if (b == 0) {       x = 1, y = 0;       return;     }     exgcd(b, a % b, y, x);     y -= a / b * x;   }   long long inv(int x) {     long long res, y;     exgcd(x, 1000000007, res, y);     res = ((res % 1000000007) + 1000000007) % 1000000007;     return res;   }   int main() {     std::ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> k >> pa >> pb;     A = pa * inv(pa + pb) % 1000000007;     B = pb * inv(pa + pb) % 1000000007;     C = pa * inv(pb) % 1000000007;     for (int i = k; i >= 1; i--)       for (int j = k; j >= 0; j--) {         if (i + j >= k) {           f[i][j] = i + C;           continue;         }         f[i][j] = (A * f[i + 1][j] + B * (f[i][i + j] + i)) % 1000000007;       }     cout << (f[1][0] + 1000000007) % 1000000007;     return 0;   }   