Sichanov

moving

May 21st, 2021
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4. total_boxes = 0
  5. total_space = width * length * height
  6. initial_space = total_space
  7. is_there_more_space = True
  8. command = input()
  9. while command != 'Done':
  10.     number_of_boxes = int(command)
  11.     total_boxes += number_of_boxes
  12.     total_space -= number_of_boxes
  13.     if total_space <= 0:
  14.         is_there_more_space = False
  15.         break
  16.     command = input()
  17. if is_there_more_space:
  18.     left_space = initial_space - total_boxes
  19.     print(f"{left_space} Cubic meters left.")
  20. else:
  21.     needed_space = total_boxes - initial_space
  22.     print(f"No more free space! You need {needed_space} Cubic meters more.")
Advertisement
Add Comment
Please, Sign In to add comment