miglenabs

Untitled

Nov 19th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import math
  2. height = int(input())
  3. width = int(input())
  4. percent_not_paint = int(input())
  5.  
  6. total_surface_area = (height * width) * 4
  7. area_for_paint = total_surface_area - (total_surface_area * (percent_not_paint / 100))
  8. meters_can_paint = 0
  9. input_line = input()
  10. while input_line != "Tired!":
  11.     liters = int(input_line)
  12.     meters_can_paint = liters
  13.     area_for_paint = math.ceil(area_for_paint - meters_can_paint)
  14.     if area_for_paint < meters_can_paint:
  15.         diff = abs(area_for_paint - meters_can_paint)
  16.         print(f"All walls are painted and you have {diff} l paint left!")
  17.         break
  18.  
  19.     input_line = input()
  20.  
  21. if input_line == "Tired!":
  22.     print(f"{area_for_paint} quadratic m left.")
  23.  
  24. if meters_can_paint == 0:
  25.     print("All walls are painted! Great job, Pesho!")
Add Comment
Please, Sign In to add comment