func_code_string: #include <bits/stdc++.h>   using namespace std;   long long mod = 1e9 + 7;   struct frac {     long long first, second;     frac(long long X = 0) : first((X % mod + mod) % mod), second(1) {}     frac(long long X, long long Y)         : first((X % mod + mod) % mod), second((Y % mod + mod) % mod) {}     frac operator+(frac a) {       return frac(first * a.second + second * a.first, second * a.second);     }     frac operator-(frac a) {       return frac(first * a.second - second * a.first, second * a.second);     }     frac operator*(frac a) { return frac(first * a.first, second * a.second); }     frac operator/(frac a) { return frac(first * a.second, second * a.first); }   };   frac pd[1010][1010], pa, emplace_back;   int va, vb, k;   frac solve(int a, int ja) {     if (a + ja >= k)       return emplace_back * ((pa + frac(a + ja)) - (pa * frac(a + ja))) /              ((pa - frac(1)) * (pa - frac(1)));     if (pd[a][ja].first != -1) return pd[a][ja];     return pd[a][ja] = pa * solve(a + 1, ja) + emplace_back * solve(a, ja + a);   }   long long modpow(long long b, long long e) {     long long ret = 1;     while (e) {       if (e & 1) ret = ret * b % mod;       b = b * b % mod;       e >>= 1;     }     return ret;   }   int main() {     for (__typeof(1010) i = (0) - ((0) > (1010)); i != (1010) - ((0) > (1010));          i += 1 - 2 * ((0) > (1010)))       for (__typeof(1010) j = (0) - ((0) > (1010)); j != (1010) - ((0) > (1010));            j += 1 - 2 * ((0) > (1010)))         pd[i][j].first = -1;     scanf( %d%d%d , &k, &va, &vb);     pa = frac(va, va + vb);     emplace_back = frac(vb, va + vb);     frac p = solve(1, 0);     frac ans = pa * p / (frac(1) - emplace_back);     printf( %lld n , ans.first * modpow(ans.second, mod - 2) % mod);   }   