Advertisement
horozov86

Energy Drinks

Jun 9th, 2023
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from collections import deque
  2.  
  3. miligrams = [int(x) for x in input().split(', ')]
  4. number_of_energy_drinks = deque(int(x) for x in input().split(', '))
  5. current_caffeinе = 0
  6.  
  7.  
  8. while miligrams and number_of_energy_drinks:
  9.     last_miligram = miligrams.pop()
  10.     first_drink = number_of_energy_drinks.popleft()
  11.     caffeine_multiply = last_miligram * first_drink
  12.    
  13.     if not caffeine_multiply > 300:
  14.         current_caffeinе += caffeine_multiply
  15.     else:
  16.         number_of_energy_drinks.append(first_drink)
  17.         current_caffeinе -= 30
  18.        
  19.    
  20.     print(number_of_energy_drinks)
  21.     print(current_caffeinе)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement