J. To the one funnel

2 sec, 256 M

A lesson of the philanthropy has the next structure: professor Mitrofan Feofanovich Cobblestone asks students absolutely randomly one by one until he asks somebody twice (only this lesson history considered). The lections course finishes when all the students are asked at least once on some lesson. You are interested in the expectation of the lessons’ number.

Input. The input line contains a natural number N (1 ≤ N ≤ 100) – the number of students.

Output. Print the expectation of lessons’ number with the accuracy up to 9 digits after the decimal point.

Input Output
1 1.000000000
5 3.769974843

 

Idea – Oleg Alexandrovich Petrov

About the post author Igor Mazurok (5 Posts)

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine KBIS Software Developer

Author Info

Igor Mazurok

PhD in Computer Science, Associate professor of Department Applied Mathematics of Odessa I.I.Mechnikov National University, Ukraine
KBIS Software Developer

Latest posts by Igor Mazurok (see all)

Leave a Reply