Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- price_washing_machine = float(input())
- price_toy = float(input())
- toy_count = 0
- money_count = 0
- money_brother = 0
- for i in range(1, n+1):
- if i % 2 == 0:
- money_count += (i/2)*10
- money_count -= 1
- else:
- toy_count += 1
- money_from_toys = toy_count * price_toy
- money_count += money_from_toys
- if money_count >= price_washing_machine:
- print(f"Yes! {abs(money_count-price_washing_machine):.2f}")
- else:
- print(f"No! {abs(money_count-price_washing_machine):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement