BLLUCK - Coincidence
Toriel is planning to create a game with prize. In this game, there are N players and N boxes each containing a piece of paper with a player's name written on it. Each player has a unique name and each box contains a different name. There are at most 1000 players playing.
Then, each player take 1 box at random such that every player got a different box. The more player got a box containing their name, the bigger the prize is. To prepare the prize, Toriel needs your help to calculate the expected number of player to get their own name.
Input.
First line is T, number of games (T<1000). Next T lines each contains N for each game.
Output
For each game, output the expected number of players to get the box containing their own name. Output exactly 6 digits after decimal points.
Example
Input: 1
1 Output: 1.000000
hide comments
pandey101299:
2019-02-28 17:21:34
easy one
|
|
darryl:
2017-06-28 08:02:24
wow |
|
gomathi ganesan:
2017-03-06 13:11:55
can anybody give some more test cases? |
|
Jacob Plachta:
2017-01-31 04:13:32
Bounds need to be stated:
|
|
Francky:
2016-11-24 18:21:40
a) hum hum... ok.. hum hum. AC.
|
|
Andy:
2016-11-24 17:49:44
Input:
|
|
abdou_93:
2016-11-24 15:48:42
more test cases
|
Added by: | Andy |
Date: | 2016-11-23 |
Time limit: | 5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | BLPCS5 |