Under construction

Still being built. Things may change

Clock

Interview

Time limit1sMemory limit1024 MB

Summary
Given the angle between the hour and minute hands in tenths of a degree, print the morning time that produces it as hh:mm.
Level

Easy3 of 10

Topics
Math, Implementation, Brute force
Solved
No attempts yet

Problem

If someone asks what time it is, most people answer with something like quarter past five or 15:29. To make it harder, you can instead answer with the angle between the hour hand and the minute hand, since that angle alone determines the time uniquely. Many people are not used to telling time this way, so a program that converts it into a more common format would be useful. Write such a program.

The clock on the left shows 01:21 and the one on the right shows 03:08.

Assume the clock has no second hand and shows only a whole number of minutes, so both hands jump forward only on whole minutes. The angle is measured from the hour hand clockwise to the minute hand (see the figure). To avoid decimals, the angle is written in tenths of a degree, so 85.585.5 degrees is written as 855855. This value is always an integer from 00 to 35953595 inclusive, and since only whole minutes are shown, it is always divisible by 55.

Input

The input is a single integer, the angle between the two hands in tenths of a degree. It is between 00 and 35953595 inclusive.

Output

Print the time that corresponds to the angle in the format hh:mm. If the hour has one digit, still print a leading zero. Assume it is morning, so every time lies between 00:00 and 11:59 inclusive.

Examples2

  1. Example 1

    Input
    855
    
    Expected output
    01:21
    
  2. Example 2

    Input
    3140
    
    Expected output
    03:08