mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-28 14:23:43 +03:00
18 lines
350 B
Python
18 lines
350 B
Python
|
def f(x, y, p=1):
|
||
|
if x + y >= 84 or p > 5:
|
||
|
return p in [3, 5]
|
||
|
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)
|