#include #include using namespace std; using mint=atcoder::modint998244353; template struct Number_Theoretic_Transform { static vectordw,dw_inv; static int log; static mint root; static void ntt(vector& f) { init(); const int n=f.size(); for(int m=n;m>>=1;) { mint w=1; for(int s=0,k=0;s& f, bool flag=true) { init(); const int n=f.size(); for(int m=1;m>=1; log++; } dw.resize(log); dw_inv.resize(log); for(int i=0;i>(i+2)); dw_inv[i]=dw[i].inv(); } } }; template vectorNumber_Theoretic_Transform::dw=vector(); template vectorNumber_Theoretic_Transform::dw_inv=vector(); template int Number_Theoretic_Transform::log=0; template mint Number_Theoretic_Transform::root=mint(3); template struct relaxed_convolution { using NTT=Number_Theoretic_Transform; relaxed_convolution(int n_):n(n_),i(0) { a.resize(n+1); b.resize(n+1); c.resize(n+1); } mint get(mint x, mint y) { assert(i<=n); a[i]=x,b[i]=y; c[i]+=a[i]*b[0]+(i?b[i]*a[0]:0); i++; if(i>n)return c[i-1]; for(int d=1,k=0;d<=i;d<<=1,k++) { if(i%(2*d)!=d)continue; f.assign(2*d,0); g.assign(2*d,0); if(i==d) { for(int j=0;ja,b,c,f,g; vector>as,bs; void calc(int k) { if((int)as.size()<=k) { as.resize(k+1); bs.resize(k+1); } if(!as[k].empty())return; int d=1< s(a.begin(),a.begin()+2*d); vector t(b.begin(),b.begin()+2*d); NTT::ntt(s); NTT::ntt(t); as[k]=s,bs[k]=t; } }; long P1,P2,Q1,Q2,T; mint dp[1<<20]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>P1>>P2>>Q1>>Q2>>T; mint P=mint(P1)/P2; mint Q=mint(Q1)/Q2; relaxed_convolution F(T+1); dp[0]=1; for(long i=1;i<=T;i++) { dp[i]=P*F.get(dp[i-1],Q.pow(i*(i-1)/2)); } mint ans=0; for(long i=0;i<=T;i++)ans+=dp[i]*Q.pow((T-i+1)*(T-i)/2); cout<