Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(x,y,k):
- bef = k - 1
- if max(x,y) >= 50:
- if bef == 3:
- return 1
- else: #bef < 3
- return 0
- elif bef == 3: #max(x,y) < 50
- return 0
- A = f(x + 3, y, k + 1)
- B = f(2 * x, y, k + 1)
- C = f(x, y + 3, k + 1)
- D = f(x, 2 * y, k + 1)
- if k % 2 == 1: #П
- return A or B or C or D
- else: #В
- return A and B and C and D
- a = []
- for s in range(28):
- if f(22, s, 1):
- a.append(s)
- print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement