#include #include using ll = long long; using ull = unsigned long long; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++) using namespace std; using namespace atcoder; using mint = modint998244353; const int inf = 1000000007; const ll longinf = 1ll << 60; vector> dp; vector> memo; mint rec(int t, int x, mint p, mint q) { if(memo[t][x]) { return dp[t][x]; } if(t == 0) { return 1; } mint ret = p * rec(t - 1, 1, p, q) + q.pow(x) * rec(t - 1, x + 1, p, q); memo[t][x] = 1; return dp[t][x] = ret; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int p1, p2, q1, q2, t; cin >> p1 >> p2 >> q1 >> q2 >> t; mint p = mint(p1) / p2; mint q = mint(q1) / q2; dp.resize(2000), memo.resize(2000); rep(i, 2000) dp[i].resize(2000); rep(i, 2000) memo[i].resize(2000); cout << rec(t, 1, p, q).val() << endl; return 0; }