Advertisement
veronikaaa86

07. Moving

Mar 27th, 2022
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. width = int(input())
  2. length = int(input())
  3. height = int(input())
  4.  
  5. volume = width * length * height
  6.  
  7. input_line = input()
  8. sum_boxes = 0
  9. while input_line != "Done":
  10. boxes = int(input_line)
  11. sum_boxes += 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