t = int(input())
a = 0
b = 0
c = 0
while True:
if t >= 300: # 5분 = 300초
t -= 300
a += 1
elif t >= 60: # 1분 = 60초
t -= 60
b += 1
elif t >= 10: # 10초
t -= 10
c += 1
elif t == 0: # t가 0초일 때
print(a, b, c)
break
else: # t가 10보다 작은 경우
print(-1)
break
최소 버튼 조작 방법을 구해야한다.
[ 문제 링크 ]
https://www.acmicpc.net/problem/10162