Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=27891
- data = open('27.txt').readlines()
- n = int(data[0])
- x = list(map(int, data[1:]))
- a, b, c, d = 0, 0, 0, 0 #a - 14, b - люб, с - 2, d - 7
- answ = 0
- for e in x:
- if e % 14 == 0:
- answ = max(answ, e * b)
- answ = max(answ, e * a)
- if e % 2 == 0:
- answ = max(answ, e * d)
- if e % 7 == 0:
- answ = max(answ, e * c)
- if e % 14 == 0:
- a = max(a, e)
- b = max(b, e)
- if e % 2 == 0:
- c = max(c, e)
- if e % 7 == 0:
- d = max(d, e)
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement