Advertisement
dimanou_04

Untitled

Sep 13th, 2022
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from collections import deque
  2.  
  3. total_food = int(input())
  4. orders = deque(map(int, input().split()))
  5.  
  6. print(max(orders))
  7. while orders:
  8. current_order = orders.popleft()
  9. if current_order <= total_food:
  10. total_food -= current_order
  11. else:
  12. print(f"Orders left: {current_order}", *orders)
  13. exit()
  14.  
  15. print("Orders complete")
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement