int x, y; cin >> n >> x >> y; pa = x * pow_mod(x + y, p - 2) % p; pb = y * pow_mod(x + y, p - 2) % p; pc = x * pow_mod(y, p - 2) % p; for (int i = n; i; --i) for (int j = n; ~j; --j) f[i][j] = i + j >= n ? (i + j + pc) % p : (pa * f[i + 1][j] + pb * f[i][i + j]) % p; cout << f[1][0] << "\n"; return0; }