Sichanov

substitute

May 24th, 2021
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. k = int(input())
  2. l = int(input())
  3. m = int(input())
  4. n = int(input())
  5. counter = 0
  6. max_subs = False
  7. for n1 in range(k, 9):
  8.     if n1 % 2 == 0:
  9.         for n2 in range(9, l - 1, -1):
  10.             if n2 % 2 == 1:
  11.                 for n3 in range(m, 9):
  12.                     if n3 % 2 == 0:
  13.                         for n4 in range(9, n - 1, -1):
  14.                             if n4 % 2 == 1:
  15.                                 if n1 == n3 and n2 == n4:
  16.                                     print("Cannot change the same player.")
  17.                                 else:
  18.                                     counter += 1
  19.                                     print(f"{n1}{n2} - {n3}{n4}")
  20.                                 if counter == 6:
  21.                                     max_subs = True
  22.                                     break
  23.                     if max_subs:
  24.                         break
  25.             if max_subs:
  26.                 break
  27.     if max_subs:
  28.         break
  29.  
Advertisement
Add Comment
Please, Sign In to add comment