Guest User

Untitled

a guest
Jun 15th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. N = int(input())
  2. a = [int(input()) for i in range(7)]
  3. m = 1001
  4. minpr = 1000001
  5. R = minpr
  6. for i in range(7,N):
  7.     x = int(input())
  8.     b = a[i % 7]
  9.     if b < m and b % 2 == 0:
  10.         m = b
  11.     if m * x < minpr and (m * x) % 2 == 0:
  12.         minpr = m * x
  13.     a[i % 7] = x
  14. if minpr != R:
  15.     print(minpr)
  16. else:
  17.     print(-1)
Advertisement
Add Comment
Please, Sign In to add comment