#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; namespace fps { using P = vector; void dft(P &f) { atcoder::internal::butterfly(f); } void idft(P &f) { atcoder::internal::butterfly_inv(f); mint c = mint(f.size()).inv(); for(auto &e : f) e *= c; } P inv(P &f, int size = -1) { assert(f[0] != 0); if(size == -1) { size = f.size(); } P g(size); g[0] = f[0].inv(); for(int d = 1; d < size; d <<= 1) { P gg(2 * d), ff(2 * d); for(int j = 0; j < min((int)f.size(), 2 * d); j++) ff[j] = f[j]; for(int j = 0; j < d; j++) { gg[j] = g[j]; } dft(ff); dft(gg); for(int j = 0; j < 2 * d; j++) ff[j] *= gg[j]; idft(ff); for(int j = 0; j < d; j++) { ff[j] = 0; } dft(ff); for(int j = 0; j < 2 * d; j++) ff[j] *= gg[j]; idft(ff); for(int j = d; j < min(2 * d, size); j++) g[j] = -ff[j]; } return g; } } // namespace fps 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; vector bumbo(t + 1), bunshi(t + 1); ll c = 0; rep(i, t + 1) { bumbo[i] = -p * q.pow(c); c += i; bunshi[i] = q.pow(c); } bumbo[0] = 1; auto ret = convolution(bunshi, fps::inv(bumbo)); cout << ret[t].val() << endl; return 0; }