mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-22 11:56:33 +03:00
14 lines
258 B
Python
Vendored
14 lines
258 B
Python
Vendored
def f(n, path):
|
|
if n >= 24:
|
|
if n == 24:
|
|
if 6 in path:
|
|
return 1
|
|
return 0
|
|
|
|
return (
|
|
f(n + 2, path + [n + 2]) + f(n * 2, path + [n * 2]) + f(n * 3, path + [n * 3])
|
|
)
|
|
|
|
|
|
print(f(1, []))
|