Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 08. Clever Lily
- age = int(input())
- washing_mashine_price = float(input())
- toy_price = int(input())
- count_toys = 0
- amount = 10
- money = 0
- for year in range(1, age+1):
- if not year % 2 ==0:
- count_toys += 1
- else:
- money += amount - 1
- amount += 10
- money += count_toys * toy_price
- diff = abs(money - washing_mashine_price)
- if money >= washing_mashine_price:
- print(f"Yes! {diff:.2f}")
- else:
- print(f"No! {diff:.2f}")
Add Comment
Please, Sign In to add comment