#include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} long long power(long long x, long long n){ long long ans = 1; for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD) if(n&1)ans*=x; return ans%MOD; } signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout< b; cin>>N>>M>>K>>p>>q; b.resize(N); P2 = p * power(q, MOD-2) % MOD; P = (q - p + MOD) % MOD * power(q, MOD-2) % MOD; E = (1 + power((P + MOD - P2)%MOD, K))%MOD; E *= power(2, MOD-2); E %= MOD; O = (1 + MOD - power((P + MOD - P2)%MOD, K))%MOD; O *= power(2, MOD-2); O %= MOD; for(int i = 0; i < N; i++) { cin>>b[i]; if(i < M) { ans += b[i] * E%MOD; } else { ans += b[i] * O%MOD; } ans %= MOD; } cout<