Sichanov

renovation

Jun 12th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. import math
  2.  
  3. wall_height = int(input())
  4. wall_width = int(input())
  5. pct_not_paintable = int(input())
  6.  
  7. total_area = 4 * wall_width * wall_height
  8. paintable_total_area = math.ceil(total_area - (total_area * pct_not_paintable / 100))
  9. command = input()
  10.  
  11. while command != "Tired!":
  12.     liters_paint = int(command)
  13.     paintable_total_area -= liters_paint
  14.     if paintable_total_area <= 0:
  15.         if paintable_total_area < 0:
  16.             print(f'All walls are painted and you have {abs(paintable_total_area)} l paint left!')
  17.         elif paintable_total_area == 0:
  18.             print("All walls are painted! Great job, Pesho!")
  19.         break
  20.     command = input()
  21. else:
  22.     print(f'{paintable_total_area} quadratic m left.')
Advertisement
Add Comment
Please, Sign In to add comment