https://www.acmicpc.net/problem/5585 시간 제한 : 1초 메모리 제한 : 128MB
chansges = 1000 - int(input()) count = 0 for i in [500, 100, 50, 10, 5, 1]: count += chansges // i chansges = chansges % i print(count)