Advertisement
veronikaaa86

07. Moving

Jul 30th, 2023
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4.  
  5. volume = width * length * height
  6.  
  7. sum_boxes = 0
  8. input_line = input()
  9. while input_line != "Done":
  10.     current_boxes = int(input_line)
  11.     sum_boxes += current_boxes
  12.  
  13.     if sum_boxes >= volume:
  14.         break
  15.  
  16.     input_line = input()
  17.  
  18. diff = abs(sum_boxes - volume)
  19. if sum_boxes >= volume:
  20.     print(f"No more free space! You need {diff} Cubic meters more.")
  21. else:
  22.     print(f"{diff} Cubic meters left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement