eolymp
bolt
Try our new interface for solving problems
Problems

The Dice Game

The Dice Game

Little John has one standard die with numbers one to six on its sides. Each time he throws the die, he gets as many candies from his mom as the number on the top of the die. John's goal is to collect at least \textbf{candies} candies. Then he will eat them all and became a little fat boy. Find the expected number of throws needed for John to achieve his goal. \InputFile Each line contains one integer \textbf{candies} (\textbf{1 }≤ \textbf{candies} ≤ \textbf{10^6}). \OutputFile For each number of candies print in a separate line the expected number of throws needed for John to achieve his goal. Each number must be printed with \textbf{4} digits after the decimal point.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
2
7
47
Output example #1
1.0000
1.1667
2.5216
13.9048