Advertisement
miglenabs

Untitled

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