lmarkov

PB - Python - May 2021 - Programming Basics Online Exam - 6 and 7 July 2019 - 04. Renovation

Jun 18th, 2021
899
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2.  
  3. h = int(input())
  4. w = int(input())
  5. no_painting_rate = 1 - int(input()) / 100
  6.  
  7. area = 4 * h * w
  8.  
  9. area_to_paint = area * no_painting_rate
  10. area_covered = 0
  11. total_paint = 0
  12. paint = 0
  13.  
  14.  
  15. paint = input()
  16. while not paint == "Tired!":
  17.     paint = int(paint)
  18.  
  19.     area_covered += paint
  20.  
  21.     if area_covered >= area_to_paint:
  22.         break
  23.  
  24.     paint = input()
  25.  
  26. difference = math.ceil(abs(area_covered - area_to_paint))
  27.  
  28. if paint == "Tired!":
  29.     print(f"{difference} quadratic m left.")
  30. elif area_covered > area_to_paint:
  31.     print(f"All walls are painted and you have {difference} l paint left!")
  32. else:
  33.     print(f'All walls are painted! Great job, Pesho!')
  34.  
RAW Paste Data