Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def F(x, y, pos):
- if x+y >= 88 and (pos == 5 or pos == 3):
- return True
- if x+y < 88 and pos >= 5:
- return False
- if x+y >= 88 and pos < 5:
- return False
- if pos % 2 == 0:
- return F(x + 1, y, pos + 1) or F(x * 3, y, pos + 1) or F(x, y+1, pos + 1) or F(x, y*3, pos + 1)
- else:
- return F(x + 1, y, pos + 1) and F(x * 3, y, pos + 1) and F(x, y+1, pos + 1) and F(x, y*3, pos + 1)
- def F1(x, y, pos):
- if x+y >= 88 and pos == 3:
- return True
- if x+y < 88 and pos >= 3:
- return False
- if x+y >= 88 and pos < 3:
- return False
- if pos % 2 == 0:
- return F1(x + 1, y, pos + 1) or F1(x * 3, y, pos + 1) or F1(x, y+1, pos + 1) or F1(x, y*3, pos + 1)
- else:
- return F1(x + 1, y, pos + 1) and F1(x * 3, y, pos + 1) and F1(x, y+1, pos + 1) and F1(x, y*3, pos + 1)
- for i in range(1, 72):
- if F(6, i, 1):
- print(i)
- print("anothr")
- for i in range(1, 72):
- if F1(6, i, 1):
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement