1888:YYS

时间限制:2 S   /  内存限制:65536 KB
AC:8   /  Submit:14
问题描述

Yinyangshi is a famous RPG game on mobile phones.

Kim enjoys collecting cards in this game. Suppose there are n kinds of cards. If you want to get a new card, you need to pay W coins to draw a card. Each time you can only draw one card, all the cards appear randomly with same probability 1/n . Kim can get 1 coin each day. Suppose Kim has 0 coin and no cards on day 0. Every W days, Kim can draw a card with W coins. In this problem ,we define W=(n-1)!.

Now Kim wants to know the expected days he can collect all the n kinds of cards.

输入描述

The first line an integer T(1 ≤ T ≤ 10). There are T test cases.

The next T lines, each line an integer n. (1≤n≤3000)

输出描述

For each n, output the expected days to collect all the n kinds of cards, rounded to one decimal place.

样例输入复制样例

4

1

2

5

9

样例输出

1.0

3.0

274.0

1026576.0

来源
2017年第八届福建省大学生程序设计竞赛正式赛G

Copyright 2016 - 2024 XUJC ACM Team
闽ICP备2020022076号-1