Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. trunk = float(input())
  3. line = input()
  4.  
  5. counter = 0
  6.  
  7. has_space = True
  8.  
  9. while line != 'End':
  10. vol = float(line)
  11. if trunk <= vol:
  12. has_space = False
  13. break
  14. trunk -= vol
  15. counter += 1
  16. if counter % 3 == 0:
  17. trunk -= vol * 0.1
  18. if trunk < 0:
  19. has_space = False
  20. counter -= 1
  21. break
  22. line = input()
  23.  
  24. if not has_space:
  25. print(f'No more space!')
  26. if has_space:
  27. print(f'Congratulations! All suitcases are loaded!')
  28.  
  29. print(f'Statistic: {counter} suitcases loaded.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement