Advertisement
HristoBaychev

Renovation

Jan 29th, 2023
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import math
  2.  
  3. height = int(input())
  4. width = int(input())
  5. total_area_uncover = int(input())
  6.  
  7. total_paint = 0
  8. area = (height * width * 4) * (total_area_uncover/100)
  9. total_area = (height * width * 4) - area
  10.  
  11. while total_paint <= total_area:
  12.     paint_litter = input()
  13.     if paint_litter == 'Tired!':
  14.         diff = math.ceil(abs(total_area - total_paint))
  15.         print(f"{diff:.0f} quadratic m left.")
  16.         break
  17.     paint_litter = int(paint_litter)
  18.  
  19.     total_paint += paint_litter
  20.  
  21.     if total_paint > total_area:
  22.         diff = math.ceil(abs(total_area - total_paint))
  23.         print(f'All walls are painted and you have {diff:.0f} l paint left!')
  24.         break
  25.     elif total_area == total_paint:
  26.         print("All walls are painted! Great job, Pesho!")
  27.  
  28.  
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement