scripts/ege/СтатГрад № 5 Файлы/9.py
2023-05-05 00:45:01 +03:00

14 lines
349 B
Python
Vendored

with open("9.txt") as f:
data = [list(map(int, x.split())) for x in f.read().splitlines()]
n = 0
for row in data:
mx = max(row)
if row.count(mx) == 1:
if [row.count(x) for x in row].count(1) != 6:
c = [x for x in row if x != mx]
if mx > sum(c) / len(c) * 3:
n += 1
print(n)