Master C

Oven timer

Oven timer

An oven's display is given a number of minutes and has to show it as hours and minutes. It is a small screen, so the format is fixed: the hours, the letter h, a space, the minutes always as two digits, and the letter m.

Write oven_timer. Divide by 60 for the hours, take the remainder for the minutes, and print the minutes with a leading zero when they are below ten.

Worked example

Input:  minutes = 105
105 / 60 = 1        (whole number division)
105 % 60 = 45
Output: "1h 45m"

Input:  minutes = 9      Output: "0h 09m"
Input:  minutes = 0      Output: "0h 00m"

Constraints

  • minutes is between 0 and 100000.
  • The hours are never padded, so 105 minutes is 1h 45m and not 01h 45m.
  • The minutes are always two digits, so 9 minutes is 0h 09m.
  • Hours above 24 are shown as they are: 1500 minutes is 25h 00m.
Code

Run your code to see how it does on the examples. Submit also runs the hidden cases.