Advertisement
nq1s788

17 (пара -- два соседних)

May 8th, 2024 (edited)
930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=37336
  2. data = open('17.txt').readlines()
  3. cnt = 0
  4. mx = -10000000
  5. for i in range(len(data) - 1):
  6.     a = int(data[i])
  7.     b = int(data[i + 1])
  8.     if (a % 3 == 0) or (b % 3 == 0):
  9.         cnt += 1
  10.         mx = max(mx, a + b)
  11. print(cnt, mx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement