scripts/ege/13022023/8.py

25 lines
708 B
Python
Raw Normal View History

2023-05-05 00:45:01 +03:00
alf = "ЕКОФ"
sgl = "КФ"
r = []
n = 1
for a in alf:
for b in alf:
for c in alf:
for d in alf:
for e in alf:
w = a + b + c + d + e
if w.count("О") == 1:
i = w.index("О")
if i == 0:
f = w[i + 1] not in sgl
elif i == 4:
f = w[i - 1] not in sgl
else:
f = w[i + 1] not in sgl and w[i - 1] not in sgl
if f:
r.append(n)
n += 1
print(min(r) + max(r))