#include using namespace std; int main() { int n, b; cin >> n >> b; double s = 0, t = 0; for (int i = 0; i < n; i++){ double a; cin >> a; s += a * pow(b, a - 1); if (abs(a + 1.0) < 1e-8) t += log(abs(b)); else t += pow(b, a + 1) / (a + 1); } cout << fixed << setprecision(12); cout << s << endl << t << endl; }