/* -*- coding: utf-8 -*- * * 3362.cc: No.3362 遨榊・!!! - yukicoder */ #include #include #include using namespace std; /* constant */ const int MAX_N = 10 + 1; /* typedef */ using ll = long long; using ld = long double; /* global variables */ int ks[MAX_N]; /* subroutines */ ld itgf(int n, int ks[], int x) { ld ex = x, sum = 0.0; for (int i = 0; i <= n; i++) { sum += ks[i] * ex / (i + 1); ex *= x; } return sum; } /* main */ int main() { int n, a, b; scanf("%d%d%d", &n, &a, &b); for (int i = 0; i <= n; i++) scanf("%d", ks + i); ld x = floorl(itgf(n, ks, b) - itgf(n, ks, a)); printf("%lld\n", (ll)x); return 0; }