desislava_topuzakova

Untitled

Jul 10th, 2021
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. trip_price = float(input())
  2. puzzles_count = int(input())
  3. dolls_count = int(input())
  4. bears_count = int(input())
  5. minions_count = int(input())
  6. trucks_count = int(input())
  7.  
  8. profit = (puzzles_count * 2.60) + (dolls_count * 3) + (bears_count * 4.10) \
  9. + (minions_count * 8.20) + (trucks_count * 2)
  10. toys_count = puzzles_count + dolls_count + bears_count + minions_count + trucks_count
  11.  
  12. #отстъпка
  13. if toys_count >= 50:
  14. profit = profit - 0.25 * profit
  15. #profit = profit * 0.75 -> profit *= 0.75
  16.  
  17. # наем
  18. profit = profit - profit * 0.10
  19. # profit = profit * 0.9 -> profit *= 0.9
  20.  
  21. if profit >= trip_price:
  22. left_money = profit - trip_price
  23. print(f'Yes! {left_money:.2f} lv left.')
  24. else:
  25. need_money = trip_price - profit
  26. print(f'Not enough money! {need_money:.2f} lv needed.')
Advertisement
Add Comment
Please, Sign In to add comment