Programming/Python & Data Structures
[Baekjoon/Python3] 2720번 세탁소 사장 동혁
HooNeee
2020. 12. 4. 01:50
[Baekjoon/Python3] 2720번 세탁소 사장 동혁
2720번: 세탁소 사장 동혁
각 테스트케이스에 대해 필요한 쿼터의 개수, 다임의 개수, 니켈의 개수, 페니의 개수를 공백으로 구분하여 출력한다.
www.acmicpc.net
t = int(input())
for i in range(t):
give_dict = {25: 0, 10: 0, 5: 0, 1: 0}
cost = int(input())
for j in give_dict.keys():
give_dict[j] = cost // j
cost %= j
print(*give_dict.values())
t = int(input())
for i in range(t):
give_list = [0 for i in range(0, 4)]
cost = int(input())
while cost != 0:
if cost >= 25:
give_list[0] = cost // 25
cost %= 25
elif cost >= 10:
give_list[1] = cost // 10
cost %= 10
elif cost >= 5:
give_list[2] = cost // 5
cost %= 5
elif cost >= 1:
give_list[3] = cost // 1
cost %= 1
print(*give_list)