# 21

Jun 24th, 2021
779
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. def f(x, y, pos):
2.     if x+y>=100 and (pos==5 or pos==3):
3.         return True
4.     if x+y<100 and pos>=5:
5.         return False
6.     if x+y>100 and pos<5:
7.         return False
8.     if pos%2==0:
9.         return f(x+5, y, pos+1) or f(x**2, y, pos+1) or f(x, y+5, pos+1) or f(x, y**2, pos+1)
10.     else:
11.         return f(x+5, y, pos+1) and f(x**2, y, pos+1) and f(x, y+5, pos+1) and f(x, y**2, pos+1)
12.
13. def f1(x, y, pos):
14.     if x + y >= 100 and pos == 3:
15.         return True
16.     if x + y < 100 and pos >= 3:
17.         return False
18.     if x + y > 100 and pos < 3:
19.         return False
20.     if pos % 2 == 0:
21.         return f1(x + 5, y, pos + 1) or f1(x ** 2, y, pos + 1) or f1(x, y + 5, pos + 1) or f1(x, y ** 2, pos + 1)
22.     else:
23.         return f1(x + 5, y, pos + 1) and f1(x ** 2, y, pos + 1) and f1(x, y + 5, pos + 1) and f1(x, y ** 2, pos + 1)
24.
25. for i in range(1, 96):
26.     if f(3, i, 1):
27.         print(i)
28. print('asdas')
29. for i in range(1, 96):
30.     if f1(3, i, 1):
31.         print(i)
RAW Paste Data