5 Big Booms
Parsa is tired of FIT1047. The FIT1047 textbook has n pages. Parsa decides to determine the average BOOM Power produced when closing the book quickly and forcefully.
Parsa randomly opens the book to a page, with each page being equally likely to be selected. If the book is opened to a certain page, the BOOM Power is equal to the smaller number of pages on either side of the book (this count can range from 0 to n). Given the number of sheets in Parsa's book, calculate the expected BOOM Power. In other words, the expected BOOM Power is given by: n+1∑i=0nmin(i,n−i) where min(a,b) is the smaller value of a and b.
Input
The only line of input contains n which is the number of pages in Parsa's book.
Output
Print the expected BOOM Power of the book. Any answer with absolute error not exceeding 10−6 will be accepted.
Constraints
- 1≤n≤2×109
Example 1
3
0.500000
Example 2
21
5.000000
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.