Clock Tower
InterviewTime limit1sMemory limit1024 MB
Given the minute M that the altered minute hand points to, find the true minute and print it with one decimal place.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Geunseong ordered a Java chip frappuccino at a cafe next to Engineering Building 7, then suddenly wondered about something and asked the barista.
Do you have a C++ chip frappuccino?
The barista, angered by Geunseong's absurd question, tied Geunseong to the minute hand of the clock tower right in front of the cafe.
Then the minute hand of the clock tower began to move strangely under Geunseong's weight. The minute hand repeats the following pattern every hour.
- At the top of every hour, the minute hand points to 12.
- From the top of the hour until 15 minutes, the minute hand moves clockwise at times the normal speed of a minute hand. In other words, in minutes the minute hand moves clockwise from 12 to 6.
- At 15 minutes past the hour, the minute hand points to 6.
- From 15 minutes past the hour until the next top of the hour, the minute hand moves clockwise at times the normal speed of a minute hand. In other words, in minutes the minute hand moves clockwise from 6 back to 12.

On a normal clock tower, the minute hand points exactly to 12 at the top of every hour and turns clockwise one full revolution per hour at a constant speed.
The hour hand of the altered clock tower turns exactly as on a normal clock tower, so it causes no trouble. However, people have started to lose track of what the actual minute is.
Look at the altered clock tower and find the correct time to tell the people.
Input
The input is a single integer , the minute that the minute hand of the altered clock tower points to.
Output
Print a real number that represents the correct minute of the time. The value must be printed with exactly one digit after the decimal point. It can always be proven that the exact answer can be printed.
Constraints
- is an integer given as input.