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