#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
double x;
double a_[50];
double sum=0;
cin >> n;
cin >> x;
for (int i=n;i>=0;i--)
{
cin>>a_[i];
sum=sum+(a_[i]*pow(x,i));
}
cout << sum;
}
Comments
Leave a comment