代码:
#include <iostream>
using namespace std;
int n;
int a[100];
double i, ans, t;
int main() {
cin >> n >> i;
for (int j = 0; j <= n; j++) {
cin >> a[j];
t = a[j];
for (int k = j; k > 0; k--) {
t /= (1 + i);
}
ans += t;
}
printf("%.3f", ans);
return 0;
}