Sichanov

suitcases

Aug 3rd, 2021 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. trunk_capacity = float(input())
  2.  
  3. free_trunk_space = trunk_capacity
  4.  
  5. suitcase_volume = input()
  6. suitcase_number = 0
  7. added = 0
  8. while suitcase_volume != 'End':
  9.     volume = float(suitcase_volume)
  10.     suitcase_number += 1
  11.     if suitcase_number % 3 == 0:
  12.         volume += volume * 0.10
  13.     if free_trunk_space < volume:
  14.         print('No more space!')
  15.         break
  16.     else:
  17.         added += 1
  18.  
  19.     free_trunk_space -= volume
  20.     suitcase_volume = input()
  21.  
  22. if suitcase_volume == 'End':
  23.     print("Congratulations! All suitcases are loaded!")
  24.  
  25. print(f'Statistic: {added} suitcases loaded.')
  26.  
Add Comment
Please, Sign In to add comment