NIKOLAY_TETUS

19

Jun 20th, 2021
748
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Петя ходит первый
  2. def F(x, y, p):
  3.     if x + y >= 87 and p == 3:
  4.         return True
  5.     elif x + y >= 87 and p < 3:
  6.         return False
  7.     elif x + y < 87 and p == 3:
  8.         return False
  9.  
  10.     return F(x + 1, y, p + 1) or F(x * 2, y, p + 1) or F(x, y + 1, p + 1) or F(x, y * 2, p + 1)
  11.  
  12. for S in range(1, 78):
  13.     if F(9, S, 1) == True:
  14.         print(S)
  15.  
RAW Paste Data