The Errand Route
InterviewTime limit1sMemory limit128 MB
Add four travel times given in seconds and print the total split into minutes on the first line and seconds on the second.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Seunggyun travels between school, the internet cafe, and the academy every day. Tired of the unchanging routine, he wants to cut down his travel time so he can stay at the internet cafe longer. So every time he moves he times himself with a stopwatch, and once he gets home he analyzes the records.
But every record is written only in seconds, which makes it a hassle to work out how many minutes and seconds his total travel time for the day was. Given the travel times (in seconds) for the day's four segments, write a program that computes the total travel time in minutes and seconds.
Input
The input consists of four lines, each containing one positive integer.
- Line 1: travel time from home to school (seconds)
- Line 2: travel time from school to the internet cafe (seconds)
- Line 3: travel time from the internet cafe to the academy (seconds)
- Line 4: travel time from the academy to home (seconds)
The total travel time is always at least 1 minute 0 seconds and at most 59 minutes 59 seconds.
Output
Print the total travel time split into minutes and seconds. Print the minutes on the first line and the seconds on the second line.