Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import deque
- miligrams = [int(x) for x in input().split(', ')]
- number_of_energy_drinks = deque(int(x) for x in input().split(', '))
- current_caffeinе = 0
- while miligrams and number_of_energy_drinks:
- last_miligram = miligrams.pop()
- first_drink = number_of_energy_drinks.popleft()
- caffeine_multiply = last_miligram * first_drink
- if not caffeine_multiply > 300:
- current_caffeinе += caffeine_multiply
- else:
- number_of_energy_drinks.append(first_drink)
- current_caffeinе -= 30
- print(number_of_energy_drinks)
- print(current_caffeinе)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement