Advertisement
denvolf2000

Станция Восход (четное произв.)

Mar 4th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. min1 = 1001 #четное
  2. min2 = 1001 #нечетное
  3. min_prod = 1001 * 1001
  4.  
  5. n = int(input())
  6.  
  7. A = [int(input()) for i in range(6)]
  8. print(A)
  9.  
  10. for i in range(n - 6):
  11.  
  12.     a = int(input())
  13.  
  14.     if (A[0] % 2 == 0) and (A[0] < min1):
  15.         min1 = A[0]
  16.     if (A[0] % 2 != 0) and (A[0] < min2):
  17.         min2 = A[0]
  18.     if (1 < 1001):
  19.         prod = a * min1
  20.         if prod < min_prod:
  21.             min_prod = prod
  22.     print(min_prod, min1, A, a)
  23.     print("min1 - ", min1 )
  24.     print("min2 - ", min2)
  25.     print("min_prod - ", min_prod)
  26.     A = A[1:] + [a]
  27.     print(A)
  28.  
  29. print('---')
  30. if min_prod == 1001 * 1001:
  31.     print(-1)
  32. else:
  33.     print(min(min_prod, min1*min2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement