mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-29 06:43:43 +03:00
13 lines
343 B
Python
Vendored
13 lines
343 B
Python
Vendored
with open("9.txt") as f:
|
|
data = [list(map(int, x.split())) for x in f.read().splitlines()]
|
|
c = 0
|
|
for row in data:
|
|
cr = sorted(row)
|
|
n1 = cr[-1] ** 2 + cr[-2] ** 2
|
|
n2 = cr[0] ** 2 + cr[1] ** 2
|
|
if n1 % n2 == 0:
|
|
if any([n1 % x == 0 or n2 % x == 0 for x in cr[2:-2]]):
|
|
print(row)
|
|
c += 1
|
|
print(c)
|