#include #include #include using namespace std; using mint = atcoder::modint998244353; int main() { int p1, p2, q1, q2, t; cin >> p1 >> p2 >> q1 >> q2 >> t; mint p = mint(p1) / p2; mint q = mint(q1) / q2; vector qpow(t + 1); qpow[0] = 1; for (int i = 0; i < t; i++) { qpow[i + 1] = q * qpow[i]; } vector dp(t + 1, vector(t + 1)); dp[0][0] = 1; for (int i = 0; i < t; i++) { mint sum; for (int j = 0; j <= i; j++) { sum += dp[i][j]; } dp[i + 1][0] = p * sum; for (int j = 0; j <= i; j++) { dp[i + 1][j + 1] = qpow[j + 1] * dp[i][j]; } } mint ans; for (int i = 0; i <= t; i++) { ans += dp[t][i]; } cout << ans.val() << endl; }