dxnge

8

Oct 17th, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. with open('17-4.txt') as f:
  2.     a = list(map(int, [0, 0]))
  3.     while s := f.readline():
  4.         num = int(s)
  5.         if num % 13 == 4 and num % 8 == 1:
  6.             a[-1]+=num
  7.             if a[0] < num:
  8.                 a[0] = num
  9. print(a[0], a[-1])
Advertisement
Add Comment
Please, Sign In to add comment