PnnK

task 17

Sep 26th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. count, maxsum = 0, 0
  2. n = open(r'D:\17.txt')
  3. a = []
  4. for line in n:
  5.     a.append(int(line))
  6. for i in range(0, len(a)):
  7.     for j in range(i, len(a)):
  8.         if (a[i]+a[j]) % 2 == 1 and (a[i]*a[j]) % 3 == 0:
  9.             count += 1
  10.             maxsum = max(maxsum, a[i]+a[j])
  11. print(count, maxsum)
Advertisement
Add Comment
Please, Sign In to add comment