Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open(r'17 (16).txt')
- msq = 100000000
- for s in f:
- if s[-1] == s[-2]:
- msq = min(msq, int(s))
- f.seek(0,0)
- msq = msq**2
- c = 0
- mxsq = 0
- a = int(f.readline())
- for s in f:
- b = int(s)
- aa = abs(a)
- ab = abs(b)
- f1 = (aa % 10 == (ab % 100 // 10)) or (ab % 10 == (aa % 100 // 10))
- f2 = (a**2 + b**2) <= msq
- f3 = (aa % 7 == 0 and ab % 7 != 0) or (ab % 7 == 0 and aa % 7 != 0)
- if f1 and f2 and f3:
- c += 1
- mxsq = max(mxsq, a**2 + b**2)
- a = b
- print(c, mxsq)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement