Advertisement
Guest User

Untitled

a guest
May 27th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. def Dequeqe():
  2.     a = queue[0]
  3.     del queue[0]
  4.     return a
  5.  
  6. n = int(input())
  7. queue = []
  8. for i in range (0, 7):
  9.     queue.append(int(input()))
  10. minc = 1001**2
  11. minn = 1001**2
  12. minp = 1001**2
  13. for i in range (7, n):
  14.     x = int(input())
  15.     b = Dequeue()
  16.     if b % 2 == 0:
  17.         if b < minc: minc = b
  18.     elif b < minn: minn = b
  19.     if x % 2 == 0:
  20.     k = min(minc, minn)
  21.         if minp < x * k: minp = x*k
  22.     elif minp < x * minc: minp = x * minc
  23.  
  24. if minp == 1001**2:
  25.     print('-1')
  26. else
  27.     print(minp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement