#P16856. [GKS 2021 #E] Increasing Sequence Card Game
[GKS 2021 #E] Increasing Sequence Card Game
Problem Description
You're playing a card game as a single player.
There are cards. The -th card has integer written on it.
You first shuffle cards randomly and put them in a pile. Take the card at the top of the pile to your hand. Then repeat the following process until the pile becomes empty:
- Check the card on the top of the pile.
- If the number on the card is larger than the number on the last card you took, take the card.
- Otherwise, discard the card.
The score of the game is the number of cards in your hand at the end. With the given number of cards , what is the expected score of the game?
Input Format
The first line of the input contains the number of test cases, . lines follow. Each line contains a single integer , the number of cards in the pile.
Output Format
For each test case, output one line containing Case #: , where is the test case number (starting from ) and is the expected score at the end of the game.
will be considered correct if it is within an absolute or relative error of of the correct answer.
2
1
2
Case #1: 1.0
Case #2: 1.5
Hint
Limits
.
Test Set 1
.
Test Set 2
.
Test Set 3
.