18. Movie Duration

Acceptance — 0 accepted 0 submissions

Easy
BasicsMath
No companies listed
Booking apps show movie length like 2h 49m instead of 169 minutes, because it is easier to read.

Given the total length of a movie in minutes, convert it into hours and minutes.

Input Format
A single integer M, the length in minutes.

Output Format
Print in the format <hours>h <minutes>m, for example 2h 49m.

Constraints
• 0 ≤ M ≤ 10000

Example 1

Input
169
Output
2h 49m

Explanation 169 = 2 × 60 + 49, so 2 hours and 49 minutes.

Example 2

Input
60
Output
1h 0m

Explanation Exactly one hour, zero minutes.

Example 3

Input
45
Output
0h 45m

Explanation Less than an hour, so 0 hours and 45 minutes.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
2h 49m
No results yet
Run your code to test it against the sample cases.
Problem List