#P16856. [GKS 2021 #E] Increasing Sequence Card Game

    ID: 17100 Type: RemoteJudge 1000ms 1024MiB Tried: 0 Accepted: 0 Difficulty: 6 Uploaded By: Tags>2021Special Judge期望调和级数Google Kick Start

[GKS 2021 #E] Increasing Sequence Card Game

题目描述

You're playing a card game as a single player.

There are NN cards. The ii-th card has integer ii written on it.

You first shuffle NN 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:

  1. Check the card on the top of the pile.
  2. If the number on the card is larger than the number on the last card you took, take the card.
  3. 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 NN, what is the expected score of the game?

输入格式

The first line of the input contains the number of test cases, TT. TT lines follow. Each line contains a single integer NN, the number of cards in the pile.

输出格式

For each test case, output one line containing Case #xx: yy, where xx is the test case number (starting from 11) and yy is the expected score at the end of the game.

yy will be considered correct if it is within an absolute or relative error of 10−610^{-6} of the correct answer.

2
1
2
Case #1: 1.0
Case #2: 1.5

提示

Limits

1≤T≤1001 \le T \le 100.

Test Set 1

1≤N≤101 \le N \le 10.

Test Set 2

1≤N≤1061 \le N \le 10^6.

Test Set 3

1≤N≤10181 \le N \le 10^{18}.