Problem:


合計時間 (Total Time)

問題

太郎君は 3 カ所の店を訪ねることを日課にしている．家を出発し，決まった順番で 3 カ所の店を回った後，家に帰る．ときどき，ストップウォッチを使って，各区間を移動するのに何秒かかったかを計り，その秒数を記録する．

ある日の計測結果が与えられたとき，この日の移動時間の合計が何分何秒かを求めるプログラムを作成せよ． 

入力

入力は 4 行からなり， 1 行に 1 つずつ正の整数が書かれている．

1 行目の整数は家から 1 つ目の店までの移動時間を表す秒数である．

2 行目の整数は 1 つ目の店から 2 つ目の店までの移動時間を表す秒数である．

3 行目の整数は 2 つ目の店から 3 つ目の店までの移動時間を表す秒数である．

4 行目の整数は 3 つ目の店から家までの移動時間を表す秒数である．ただし，与えられる入力データにおいては合計移動時間は 1 分 0 秒以上で 59 分 59 秒以下であることが保証されている．

出力

出力は 2 行からなる．x 分 y 秒 (1 ≤ x ≤ 59 , 0 ≤ y ≤ 59 )のとき， 1行目に x を，2行目に y を出力せよ．

入出力例

入力例 1
  

31
34
7
151

出力例 1

3
43

入力例 2
  

316
430
643
1253

出力例 2

44
2

入力例 3
  

5
10
15
30

出力例 3

1
0

問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。



Sample input:
31
34
7
151


Sample output:
3
43

Submission status: Wrong Answer

Solution code:
a,b,c,d = int(input()),int(input()),int(input()),int(input())
e = a+b+c+d
g =e
t=0
while(g > 0):
  g -= 60
  t+=1
print t-1
print e%60

Submission status: Wrong Answer

Solution code:
a,b,c,d = int(input()),int(input()),int(input()),int(input())
e = a+b+c+d
g =e
t=0
while(g > 0):
  g -= 60
  t+=1
if t==1:
  print t
else:
  print t-1
print e%60

Submission status: Accepted

Solution code:
t = 0
for _ in range(4):
    t += int(input())
else:
    print(t//60)
    print(t%60)

Submission status: Accepted

Solution code:
#py3
time = 0
for i in range(4):
  time += int(input())

print(int(time/60))
print(int(time%60))

Submission status: Accepted

Solution code:
c=0
for i in range(4):
  n=int(input())
  c+=n
m=c//60
s=c-(m*60)
print(int(m))
print(int(s))

Submission status: Accepted

Solution code:
a = 60
s = 0
for i in range(4):
    s += input()
print s/a
print s%a

Submission status: Accepted

Solution code:
def my_range():
    for i in range(4):
        a=int(input())
        yield a

ss=sum(my_range())

x=int(ss/60)
y=int(ss%60)

print(x)
print(y)

Submission status: Accepted

Solution code:
sum = 0
for i in range(4):
  a = int(input())
  sum += a
hun = sum % 60
print(sum // 60)
print(hun)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
'import sys'
'import math'
i=int(4)
t=0
while i:
    t+=int(input())
    i-=1
print(int(t/60))
print(t%60)

Submission status: Accepted

Solution code:
ts = sum([int(input()) for _ in range(4)])
t = [ts//60, ts-((ts//60)*60)]
print("\n".join(map(str, t)))

Submission status: Accepted

Solution code:
t=sum(int(input()) for _ in[0]*4)
print(t//60,t%60,sep='\n')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0554

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    times = [int(input()) for x in range(4)]
    total_time = sum(times)

    print(total_time // 60)
    print(total_time % 60)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import sys

a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())
d = int(sys.stdin.readline())

sum_4 = a + b + c + d
minutes = int(sum_4 / 60)
seconds = sum_4 % 60

print(minutes)
print(seconds)

Submission status: Accepted

Solution code:
def main():
    sum = 0
    for _ in range(4):
        sum += int(input())
    x = sum // 60
    y = sum % 60
    print(x)
    print(y)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
time=[int(input())for i in range(4)]
t_sum=0
for t in time:
    t_sum+=t
print(str(t_sum//60)+"\n"+str(t_sum%60))

Submission status: Accepted

Solution code:
time = [int(input()) for i in range(4)]
goukei = sum(time)
print(goukei//60)
print(goukei%60)

Submission status: Accepted

Solution code:
t=sum(int(input())for _ in[0]*4)
print(t//60)
print(t%60)

Submission status: Accepted

Solution code:
t=sum(int(input())for _ in[0]*4)
print(t//60,t%60,sep='\n')

Submission status: Accepted

Solution code:
a,b,c,d = [int(input()) for _ in range(4)]
if (a + b + c + d) // 60:
  print((a + b + c + d) // 60)
print((a + b + c + d) % 60)

Submission status: Accepted

Solution code:
time = []
for i in range(4):
    time.append(int(input()))

print(sum(time) // 60)
print(sum(time) % 60)

Submission status: Accepted

Solution code:
# AOJ 0554: Total Time
# Python3 2018.6.30 bal4u

s = sum([int(input()) for i in range(4)])
print(s//60, s%60, sep='\n')

Submission status: Accepted

Solution code:
t =0
for a in range(4):
  y = int(input())
  t += y
c = t
g=0
while True:
 if c <0: break
 else:
  c-=60
  g+=1
g-=1
print g
print t%60

Submission status: Accepted

Solution code:
#!/usr/bin/env python
#-*- coding:utf-8 -*-
t = 0
for i in range(4):
	t += input()
print t / 60
print t % 60

Submission status: Accepted

Solution code:
t = sum(input() for i in range(4))
print t / 60
print t % 60

Submission status: Accepted

Solution code:
sec=input()+input()+input()+input()
print sec/60
print sec%60

Submission status: Accepted

Solution code:
s=sum(input() for i in range(4))
print s/60
print s%60

Submission status: Accepted

Solution code:
t=sum([input()for i in range(4)])
print "%d\n%d"%(t/60,t%60)

Submission status: Accepted

Solution code:
sec = 0
for i in range(4):
  sec += input()
print sec / 60
print sec % 60

Submission status: Accepted

Solution code:
sums = 0
for i in range(4):
    sums += int(raw_input())
print sums/60
print sums%60

Submission status: Accepted

Solution code:
s=sum([input() for i in [1]*4])
print s//60
print s%60

Submission status: Accepted

Solution code:
s=sum([input() for i in [1]*4])
print s/60
print s%60

Submission status: Accepted

Solution code:
seconds = sum([int(input()) for i in range(4)])

print(seconds // 60)
print(seconds % 60)

Submission status: Accepted

Solution code:
s=[int(input()) for _ in range(4)]
S=s[0]+s[1]+s[2]+s[3]
print("{}\n{}".format(S//60,S%60))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n1=int(input())
n2=int(input())
n3=int(input())
n4=int(input())

n=sum((n1,n2,n3,n4))

x=n//60
y=n-(x*60)

print(x)
print(y)

Submission status: Accepted

Solution code:
t=sum(int(input())for i in range(4))
print(t//60);print(t%60)

Submission status: Accepted

Solution code:
T = 0
for i in range(4):
    t  = int(input())
    T += t
print(T//60)
print(T%60)

Submission status: Accepted

Solution code:
total=sum([int(input()) for _ in range(4)])
print(total//60)
print(total%60)

Submission status: Accepted

Solution code:
s = 0
for i in range(4) :
    s += int(input())
print(s // 60)
print(s % 60)

Submission status: Accepted

Solution code:
seconds = sum([int(input()) for _ in range(4)])

print(seconds // 60)
print(seconds % 60)

Submission status: Accepted

Solution code:
i = 0
for num in range(4):
    num1 = int(input())
    i += num1
print(i // 60)
print(i % 60)

Submission status: Accepted

Solution code:
import sys
s1=int(input())
s2=int(input())
s3=int(input())
s4=int(input())
sum_second=s1+s2+s3+s4
x=sum_second//60
y=sum_second%60
print(x)
print(y)

Submission status: Accepted

Solution code:
N=0
for i in range(4):
  N=N+int(input())
print(N//60)
print(N%60)

Submission status: Accepted

Solution code:
m, s = divmod(sum(int(input()) for _ in range(4)), 60)
print(m)
print(s)

Submission status: Accepted

Solution code:
total = 0
for i in range(4):
    total += int(input())
print(total // 60, total % 60, sep='\n')

Submission status: Accepted

Solution code:
T=[int(input()) for i in range(4)]
Total=sum(T)
print(Total//60)
print(Total%60)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
total = a+b+c+d
print(total//60)
print(total%60)

Submission status: Accepted

Solution code:
a = [int(input()) for _ in range(4)]
print(sum(a)//60)
print(sum(a)%60)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
sum = a + b + c + d
print(sum//60)
print(sum%60)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())

T = A + B + C + D
m = T // 60
s = T - m * 60
print(m)
print(s)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=a+b+c+d
print(e//60)
print(e-60*(e//60))

Submission status: Accepted

Solution code:
def main():
    s = sum([int(input()) for _ in range(4)])

    print(s // 60)
    print(s % 60)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=0
for i in range(4):
    
    a=int(input())
    S+=a
x=int(S/60)
y=S-(60*x)
print(x)
print(y)

Submission status: Accepted

Solution code:
a,b,c,d = [int(input()) for _ in range(4)]
print((a+b+c+d)//60)
print((a+b+c+d)%60)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

t = a+b+c+d
x = t // 60
y = t - (x*60)
print(x)
print(y)

Submission status: Accepted

Solution code:
n = 4
list = []
for i in range(n):
    list.append(int(input()))
a, b, c, d = list
print((a + b + c + d) // 60)
print((a + b + c + d) % 60)

Submission status: Accepted

Solution code:
s = sum([int(input()) for i in range(4)])
print(s//60, s%60, sep='\n')

Submission status: Accepted

Solution code:
N = 4
a= [int(input()) for _ in range(N)]


kei=a[0]+a[1]+a[2]+a[3]
m=kei//60
s=kei%60
print(m)
print(s)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print((a+b+c+d)//60)
print((a+b+c+d)%60)

Submission status: Accepted

Solution code:
time = 0
for _ in range(4):
    time += int(input())

minute = time // 60
second = time % 60

print(minute)
print(second)

Submission status: Accepted

Solution code:
for i in divmod(sum([int(input()) for _ in range(4)]),60):
    print(i)

Submission status: Accepted

Solution code:
all = 0
for i in range(4):
    all += input()
minute = all / 60
second = all - minute * 60
print minute
print second

Submission status: WA: Presentation Error

Solution code:
s=sum([input() for i in [1]*4])
print s//60,"\n",s%60