Advertisement
Spocoman

Renovation

Feb 9th, 2022 (edited)
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. import math
  2.  
  3. x = int(input())
  4. y = int(input())
  5. non_paint = int(input())
  6. paint = math.ceil(x * y * 4 - (x * y * 4 * non_paint / 100))
  7. total = 0
  8. painting = input()
  9. while painting != "Tired!":
  10.     part_paint = int(painting)
  11.     total += part_paint
  12.     if total >= paint:
  13.         break
  14.     painting = input()
  15.  
  16. if total < paint:
  17.     print(f"{paint - total} quadratic m left.")
  18. elif total == paint:
  19.     print("All walls are painted! Great job, Pesho!")
  20. else:
  21.     print(f"All walls are painted and you have {total - paint} l paint left!")
  22.  
  23.  
  24. ИЛИ:
  25.  
  26. import math
  27.  
  28. x = int(input())
  29. y = int(input())
  30. non_paint = int(input())
  31. paint = math.ceil(x * y * 4 - (x * y * 4 * non_paint / 100))
  32.  
  33. painting = input()
  34. while painting != "Tired!":
  35.     paint -= int(painting)
  36.     if paint <= 0:
  37.         break
  38.     painting = input()
  39.  
  40. if paint > 0:
  41.     print(f"{paint} quadratic m left.")
  42. elif paint == 0:
  43.     print('All walls are painted! Great job, Pesho!')
  44. else:
  45.     print(f'All walls are painted and you have {abs(paint)} l paint left!')
  46.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement