Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- #встроенным максимумом на егэ
- #пользоваться нельзя
- def max(a, b):
- if (a > b):
- return a
- return b
- a = [0] * 9
- for i in range(9):
- a[i] = int(input())
- mxo = 0 #max odd
- mxe = 0 #max even
- ans = 0 #answer
- for i in range(n - 9):
- #обновление максимумов
- if (a[i % 9] % 2 == 0):
- mxe = max(a[i % 9], mxe)
- else:
- mxo = max(a[i % 9], mxo)
- #считал+обновил ответ
- x = int(input())
- if (x % 2 == 0):
- ans = max(ans, x * max(mxe, mxo))
- else:
- ans = max(ans, x * mxe)
- #обновил мою очередь
- a[i % 9] = x
- print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement