csc-python-solutions/06D/1 - Timbits.py

17 lines
315 B
Python
Raw Normal View History

2021-02-18 18:19:09 +00:00
timbitsLeft = int(input())
totalCost = 0
bigBoxes = int(timbitsLeft / 40)
totalCost = bigBoxes * 6.19
timbitsLeft -= 40 * bigBoxes
if timbitsLeft >= 20:
totalCost += 3.39
timbitsLeft -= 20
if timbitsLeft >= 10:
totalCost += 1.99
timbitsLeft -= 10
totalCost += timbitsLeft * 0.20
2021-02-18 18:19:09 +00:00
print(totalCost)