Advertisement
Korotkodul

ege_35479

Apr 4th, 2023 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def f(x, y, h):
  2.     if x + y >= 77:
  3.         if h % 2 == 0:
  4.             return 1
  5.         else:
  6.             return 0
  7.     if x + y >= 77 and h > 10:
  8.         return 0
  9.    
  10.  
  11.  
  12.     A = f(x, y + 1, h + 1)
  13.     B= f(x, y * 2, h + 1)
  14.     C = f(x + 1, y, h + 1)
  15.     D = f(x * 2, y, h + 1)
  16.     if h % 2 == 1:
  17.         return A or B or C or D
  18.     else:
  19.         return A and B and C and D
  20.  
  21.  
  22. for S in range(68, 0, -1):
  23.     print(S)
  24.     if f(8, S, 0):
  25.         print(S)
  26.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement