Advertisement
miglenabs

Untitled

Nov 2nd, 2022
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. capacity = float(input())
  2.  
  3. num_baggage = 0
  4. free_volume = 0
  5. input_line = input()
  6. while input_line != "End":
  7.     volume_per_baggage = float(input_line)
  8.  
  9.     if volume_per_baggage % 3 == 0:
  10.         volume_per_baggage = volume_per_baggage * 0.1
  11.     free_volume = capacity - volume_per_baggage
  12.     num_baggage += 1
  13.  
  14.     if volume_per_baggage > free_volume:
  15.         break
  16.  
  17.     input_line = input()
  18.  
  19. if volume_per_baggage > free_volume:
  20.     print("No more space!")
  21. if input_line == "End":
  22.     print("Congratulations! All suitcases are loaded!")
  23.  
  24. print(f"Statistic: {num_baggage} suitcases loaded.")
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement