코딩테스트
09/03 코딩테스트 백준 10162 전자레인지 Python
박준희
2021. 9. 3. 17:18
728x90
https://www.acmicpc.net/problem/10162
10162번: 전자레인지
3개의 시간조절용 버튼 A B C가 달린 전자레인지가 있다. 각 버튼마다 일정한 시간이 지정되어 있어 해당 버튼을 한번 누를 때마다 그 시간이 동작시간에 더해진다. 버튼 A, B, C에 지정된 시간은
www.acmicpc.net
import math
t = int(input())
button = [300, 60, 10]
usedButton = []
for b in button:
tmp = math.trunc(t / b)
t -= b * tmp
usedButton.append(str(tmp))
if(t == 0):
print(' '.join(usedButton))
else:
print(-1)
728x90