coins = [1, 5, 10, 50, 100]
K = 470

coins.sort(reverse=True)
count = 0
for coin in coins:
    if K == 0:
        break
    num = K // coin
    count += num
    K -= coin * num

print(count)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: