mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-22 11:56:33 +03:00
18 lines
345 B
Python
Vendored
18 lines
345 B
Python
Vendored
def f(x, y, p=1):
|
|
if x + y >= 84 or p > 3:
|
|
return p == 3
|
|
res = [
|
|
f(x + 1, y, p + 1),
|
|
f(x, y + 1, p + 1),
|
|
f(x + y * 2, y, p + 1),
|
|
f(x, y + x * 2, p + 1),
|
|
]
|
|
if p % 2 == 1:
|
|
return all(res)
|
|
return any(res)
|
|
|
|
|
|
for s in range(1, 76):
|
|
if f(8, s):
|
|
print(s)
|