Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- working_bees = deque(map(int, input().split()))
- nectars = list(map(int, input().split()))
- symbols = deque(input().split())
- total_honey = 0
- while working_bees and nectars:
- bee = working_bees.popleft()
- nectar = nectars.pop()
- if bee > nectar:
- working_bees.appendleft(bee)
- elif bee <= nectar:
- curr_symbol = symbols.popleft()
- if curr_symbol == "/" and nectar == 0:
- continue
- else:
- expression = f"{bee} {curr_symbol} {nectar}"
- result = abs(eval(expression))
- total_honey += result
- print(f"Total honey made: {total_honey}")
- if working_bees:
- print(f"Bees left: {', '.join(map(str, working_bees))}")
- if nectars:
- print(f"Nectar left: {', '.join(map(str, nectars))}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement