GroZnik81

Pizzaaa

Apr 14th, 2021
399
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from collections import deque
  2.  
  3. pizza_orders = deque(int(pizza_ord) for pizza_ord in input().split(", "))
  4. employees_make_pizza = list(int(pizza_maker) for pizza_maker in input().split(", "))
  5.  
  6. orders_are_completed = 0
  7.  
  8. while pizza_orders and employees_make_pizza:
  9.     current_order = pizza_orders[0]
  10.     current_maker = employees_make_pizza[-1]
  11.  
  12.     if current_order > 10 or current_order <= 0:
  13.         pizza_orders.popleft()
  14.     elif current_order > current_maker:
  15.          left_order = current_order - current_maker
  16.          current_order = left_order
  17.          pizza_orders.extend(left_order)
  18.          employees_make_pizza.pop()
  19.  
  20.     elif current_order <= current_maker:
  21.         pizza_orders.popleft()
  22.         employees_make_pizza.pop()
  23.         orders_are_completed += current_order
  24.         if current_order > current_maker:
  25.             left_order = current_order - current_maker
  26.             current_order += left_order
  27.  
  28.  
  29. if len(employees_make_pizza) > 0:
  30.     print(f"All orders are successfully completed!")
  31.     print(f"Total pizzas made: {orders_are_completed}")
  32.     print(f"Employees: {(', '.join(str(lc) for lc in employees_make_pizza))}")
  33. else:
  34.     print(f"Not all orders are completed.")
  35.     print(f"Orders left: {(', '.join(str(lc)for lc in left_order))}")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×