#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) typedef long long ll; int main(){ int N; cin >> N; int B; cin >> B; double a[N]; FOR(i,0,N) cin >> a[i]; double fb = 0; FOR(i,0,N){ fb += a[i] * pow(B, a[i]-1); } double Fb = 0; FOR(i,0,N){ if(a[i] == -1){ Fb += log(B); } else { Fb += pow(B, a[i]+1) / (a[i]+1); } } printf("%.06lf\n", fb); printf("%.06lf\n", Fb); return 0; }