Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(s, cnt):
- if s >= 43 and cnt - 1 == 2:
- return 1
- if s >= 43 and cnt - 1 < 2:
- return 0
- if s < 43 and cnt - 1 == 2:
- return 0
- A = f(s + 1, cnt + 1)
- B = f(s * 3, cnt + 1)
- C = f(s + 4, cnt + 1)
- if cnt % 2 == 1:
- return A and B and C
- else:
- return A or B or C
- for s in range(1, 43):
- A = s + 1 <= 42 and ( (s + 1) * 3 >= 43 or f(s + 1, 0) )
- B = s + 4 <= 42 and ( (s + 4) * 3 >= 43 or f(s + 4, 0) )
- C = s * 3 <= 42 and ( s * 9 >= 43 or f(s * 3, 0) )
- if A and B and C:
- print(s)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement