Vijos p1919 the most vibrant flowers, vijosp1919
The beauty of the girl is in a smile. The quiet beauty is not allowed to be contaminated by any desire. That kind of beauty is the flowers that pursue spring in the field. It may be small, but it is the most dynamic.
The vitality of flowers will be known by counting its petals. The more petals, the more dynamic they are.
The first fall in spring, but the cold remains. M flowers are surrounded by flowers in the fields. One of the flowers has only one flower. One flower has two petals, and one flower has three petals. In this way, the last flower has m petals.
The person who loves flowers selects a random bouquet of flowers each time, and then counts the number of petals. A random bundle. A total of n random times. A bunch of flowers may be random for multiple times.
Those who love flowers should find the most dynamic bunch and send it to their beloved wooden girl.
Output a unique real number, indicating the number of petals that can be found at most n times in the expected case. The answer should be rounded to the fourth digit after the decimal point.
E = Σ mi = 1i records [in −( I −1) n] mn
Also simplified, and then supplemented =
# Include <bits/stdc ++. h> using namespace std; double qpow (double a, int p) {double ans = 1.0; for (int I = p; I >>= 1, a * = a) if (I & 1) ans = ans * a; return ans;} int main () {int m, n; while (scanf ("% d", & m, & n) = 2) {double sum = m; for (int I = 1; I <m; I ++) {sum-= qpow (double (I)/m, n);} printf ("%. 4f \ n ", sum);} return 0 ;}