2263: Endless Spin

内存限制:128 MB 时间限制:2.000 S
评测方式:文本比较 命题人:
提交:1 解决:0

题目描述

I spin it again and again,and throw it away finally.
So now I have a row of n ball,named from 1 to n,each ball is white initially.
At each step I randomly chose a interval [l, r] and paint all ball in this interval to black.


It means every interval have a equal chance of being chosen.
And I'll stop if all ball are black.What is the expected steps before I stop?

输入

The first line contains integer T(1<=T<=50). Denoting the number of the test cases.
Then T lines follows, each line contains an integer n (1<=n<=50).

输出

For each test cases,print the answer in a line.
Print the answer rounded to 15 decimal places.

样例输入 复制

3
1
2
3

样例输出 复制

1.000000000000000
2.000000000000000
2.900000000000000

来源/分类