Open Leeee1111 opened 1 month ago
def calculate_change(total, small, medium, large):
cost = small * 15 + medium * 5 + large * 13
if cost > total:
return "0"
change = total - cost
dollars = change // 10
change %= 10
nickels = change // 5
pennies = change % 5
return f"{pennies}\n{nickels}\n{dollars}"
total, small, medium, large = map(int, input().split())
print(calculate_change(total, small, medium, large))