func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2222, mod = 998244353;   int add(int x, int y) {     x += y;     return x >= mod ? x - mod : x;   }   int mul(int x, int y) { return 1ll * x * y % mod; }   int qpow(int a, int b) {     int ans = 1;     while (b) {       if (b & 1) ans = mul(ans, a);       a = mul(a, a), b >>= 1;     }     return ans;   }   int f[maxn][maxn], g[maxn], h[maxn], n, p, q, a, b, pp[maxn], pq[maxn],       cc[maxn];   int main() {     cin >> n >> a >> b;     p = mul(a, qpow(b, mod - 2));     q = add(1, mod - p);     for (int i = pp[0] = pq[0] = 1; i <= n; i++)       pp[i] = mul(pp[i - 1], p), pq[i] = mul(pq[i - 1], q);     f[0][0] = 1;     for (int i = 0; i < n; i++) {       for (int j = 0; j <= i; j++) {         f[i + 1][j + 1] = add(f[i + 1][j + 1], mul(f[i][j], pq[i - j]));         f[i + 1][j] = add(f[i + 1][j], mul(f[i][j], pp[j]));       }     }     g[1] = 1, g[2] = 0;     for (int i = 3; i <= n; i++) {       g[i] = 1;       for (int j = 1; j < i; j++) g[i] = add(g[i], mod - mul(g[j], f[i][j]));       cc[i] = 1ll * i * (i - 1) / 2 % mod;     }     cc[2] = 1;     h[1] = 0, h[2] = 1;     for (int i = 3; i <= n; i++) {       for (int j = 1; j < i; j++) {         h[i] =             add(h[i], mul(mul(f[i][j], g[j]),                           add(h[j], add(h[i - j], add(cc[i], mod - cc[i - j])))));       }       h[i] = add(h[i], mul(g[i], cc[i]));       h[i] = mul(h[i], qpow(add(1, mod - g[i]), mod - 2));     }     cout << h[n];     return 0;   }   