406181: GYM102302 F Drawing cards

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Drawing cardstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You have a box with N cards numbered 1...N and you can also create new cards.

You are going to draw cards from the box, every time you draw a card of a number that has already been drawn you put that card back into the box. If you draw a card of a number that has not been drawn before, you lay it on the desk and you create another card to put back into the box. The number of the new card is chosen randomly with the same probability from the interval [1, N].

In this problem you have to answer what is the expected number of cards on the desk when you draw a card numbered 1 for the first time.

Input

One integer N (1 ≤ N ≤ 106).

Output

One floating point number, the expected number of cards on the desk when a card with the number 1 is drawn for the first time. Your answer will be considered correct if the absolute and relative error compared with the judge's solution is less than 10 - 4.

ExampleInput
2
Output
1.5000000000

Source/Category

加入题单

上一题 下一题 算法标签: