Guest User

Untitled

a guest
Jun 13th, 2015
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. n = int(input())
  2. m = float(input())
  3. q = [float(input()) for i in range(5)]
  4. x = float(input())
  5. if x*m % 2 == 1:
  6.     Rmin = m*x
  7.     for i in range(n-7):
  8.         m = min(m, q[0])
  9.         q.pop(0)
  10.         q.append(x)
  11.         x = float(input())
  12.         if x*m % 2 == 1:
  13.             Rmin = min(Rmin, x*m)
  14. else:
  15.     Rmin = m*x
  16.     for i in range(n-7):
  17.         m = min(m, q[0])
  18.         q.pop(0)
  19.         q.append(x)
  20.         x = float(input())
  21.         if x*m % 2 == 1:
  22.             Rmin = min(Rmin, x*m)
  23.         else:
  24.             Rmin = -1
  25. print(Rmin)
Advertisement
Add Comment
Please, Sign In to add comment