Advertisement
Guest User

27

a guest
Jun 13th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. s = 6
  2. N = int(input())
  3. result = 1000*1000
  4. a = [1000]*s
  5. n = int(input())
  6. if n % 2 != 0:
  7.     a[0] = n
  8. for i in range(1, s):
  9.     n = int(input())
  10.     if n % 2 != 0:
  11.         a[i] = min(n, a[i-1])
  12. for i in range(s, N):
  13.     n = int(input())
  14.     if n % 2 != 0:
  15.         result = min(n*a[i % s], result)
  16.         a[i % s] = min(a[(i-1) % s], n)
  17. if result % 2 != 0:
  18.     print(result)
  19. else:
  20.     print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement