본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#226 백준 파이썬 [2720] 세탁소 사장 동혁

https://www.acmicpc.net/problem/2720

 

Python Code

T = int(input())

for _ in range(T):
    money = int(input())        
    coin = {25: 0, 10: 0, 5: 0, 1: 0}
    
    while money:
        for num in [25, 10, 5, 1]:
            while money >= num:
                money -= num
                coin[num] += 1
                
    print(coin[25], coin[10], coin[5], coin[1])