#include #define fi first #define se second #define rep(i,s,n) for (int i = (s); i < (n); ++i) #define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define len(x) (int)(x).size() #define dup(x,y) (((x)+(y)-1)/(y)) #define pb push_back #define eb emplace_back #define Field(T) vector> using namespace std; using ll = long long; using ull = unsigned long long; template using pq = priority_queue,greater>; using P = pair; templatebool chmax(T&a,T b){if(abool chmin(T&a,T b){if(b> n >> a >> b; vector k(n+1); rep(i,0,n+1) cin >> k[i]; double ans = 0; double ap = 1, bp = 1; rep(i,0,n+1) { ap *= a, bp *= b; ans += (bp-ap)*k[i]/double(i+1); } cout << ll(floor(ans)) << endl; return 0; }