2747Forever97 and the dice

2747   Forever97 and the dice

题目描述

Forever97 was interested in the dice. He has a dice with n faces: the first face of the dice contains a dot, the second one contains two dots, and so on, the n-th face contains n dots. Each face appears with probability 1/n when the dice is tossed. And each toss is independent from others. Now Forever97 wants to know the expected maximum number of dots he could get after tossing the dice m times. But he is busily engaged in studying math. Help him.

输入格式:

The input contains t (t<=100) test cases. Each of them contains two integers n and m (1 <= n, m <= 105).

输出格式:

For each case, output a single real number corresponding to the expected maximum in a line. Your computed values are to be printed with four digits after the decimal point.

输入样例 复制
6 1
2 2
6 3
输出样例 复制
3.5000
1.7500
4.9583

说明

5
16
通过提交
时空限制1000ms/32mb
题目来源
评测方式在线评测
题目类型
难        度