A - Little Pony and Expected Maximum
$ ans = sum_i^niP_ ext{最大值为k}$
$ = sum_i^n i((i)k-(i-1)k) $
#include<bits/stdc++.h>
using namespace std;
double qpow(double x,int base){
long double xt = x;
long double ret = 1;
while (base > 0){
if (base & 1){
ret *= xt;
}
xt *= xt;
base /= 2;
}
return ret;
}
int main(){
int n, k;
cin >> n >> k;
double ans = 0;
for (int i=1;i<=n;i++){
ans += (qpow((double)(i-1) / n, k) - qpow((double)i/n, k)) * i;
}
printf("%.8f",-ans);
}