Advertisement
Martin_D24

Untitled

Apr 30th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. budget = float(input())
  2. N = int(input())
  3. M = int(input())
  4. P = int(input())
  5.  
  6. graphics_price = 250
  7. processor_price = 0.35*graphics_price*N
  8. RAM_price = 0.1*graphics_price*N
  9.  
  10. total_price = N*graphics_price + M*processor_price + P*RAM_price
  11. if N > M:
  12. total_price *= 0.85
  13.  
  14. if budget > total_price:
  15. diff = budget - total_price
  16. print(f"You have {diff:.2f} leva left!")
  17. else:
  18. diff = total_price - budget
  19. print(f"Not enough money! You need {diff:.2f} leva more!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement