This page is still under construction.

Parts of this page are still being built. What you see may change.

The Errand Route

Interview

Time limit1sMemory limit128 MB

Summary
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 xx on the first line and the seconds yy on the second line.

Examples3

  1. Example 1

    Input
    31
    34
    7
    151
    
    Expected output
    3
    43
    
  2. Example 2

    Input
    316
    430
    643
    1253
    
    Expected output
    44
    2
    
  3. Example 3

    Input
    5
    10
    15
    30
    
    Expected output
    1
    0