func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2005, P = 998244353;   using ll = long long;   ll qpow(ll a, ll b) {     ll ret = 1;     while (b) {       if (b & 1) ret = ret * a % P;       a = a * a % P;       b >>= 1;     }     return ret;   }   int n, a, b;   ll pw[N * N], pw1[N * N];   ll dp[N][N], f[N], g[N], h[N];   int main() {     ios::sync_with_stdio(false);     cin >> n >> a >> b;     ll p = a * qpow(b, P - 2) % P;     if (n == 1) {       cout << 0 << endl;       return 0;     }     if (n == 2) {       cout << 1 << endl;       return 0;     }     pw[0] = pw1[0] = 1;     for (int i = 1; i <= n * n; i++) {       pw[i] = pw[i - 1] * p % P;       pw1[i] = pw1[i - 1] * (P - p + 1) % P;     }     dp[0][0] = 1;     for (int i = 1; i <= n; i++) {       dp[i][0] = 1;       for (int j = 1; j <= i; j++)         dp[i][j] = (dp[i - 1][j] * pw1[j] + dp[i - 1][j - 1] * pw[i - j]) % P;     }     for (int i = 1; i <= n; i++) {       f[i] = 1;       for (int j = 1; j < i; j++) f[i] = (f[i] + P - f[j] * dp[i][j] % P) % P;     }     for (int i = 3; i <= n; i++) {       ll tt = i * (i - 1) / 2;       for (int j = 1; j < i; j++) {         ll tmp = (g[j] + h[i - j]) * f[j] % P * dp[i][j] % P;         tt = (tt + tmp) % P;       }       g[i] = tt * qpow(P + 1 - f[i], P - 2) % P;       tt = f[i] * g[i] % P;       for (int j = 1; j < i; j++) {         ll tmp = (g[j] + h[i - j]) * f[j] % P * dp[i][j] % P;         tt = (tt + tmp) % P;       }       h[i] = tt;     }     cout << g[n] << endl;     return 0;   }   