#include using namespace std; int main(){ int n,b; cin >> n >> b; vector a(n); for(auto &x:a) cin >> x; long double x1 = 0.0, x2 = 0.0; for(int i = 0; i < n; i++){ x1 += a[i] * pow(b,a[i] - 1.0); if(a[i] == -1) x2 += log(b); else x2 += 1.0 / (a[i] + 1.0) * pow(b,a[i] + 1.0); // cout << "x1 = " << x1 << endl; // cout << "x2 = " << x2 << endl; } printf("%.10Lf\n%.10Lf\n",x1 ,x2); return 0; }