Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. n = int(input())
  2. a = [0] * n
  3. for i in range(n):
  4.     a[i] = int(input())
  5. Max = a[0]
  6. P = -1
  7. for i in range(8, n):
  8.     if a[i - 8] > Max:
  9.         Max = a[i - 8]
  10.     if Max * a[i] > P:
  11.         P = Max * a[i]
  12. print(P)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement