Sichanov

substitute

May 24th, 2021
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 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
  8.     for n2 in range(9, l - 1, -1): # 9
  9.         for n3 in range(m, 9):
  10.             for n4 in range(9, n - 1, -1):
  11.                 if n1 % 2 == 0 and n2 % 2 == 1 and n3 % 2 == 0 and n4 % 2 == 1:
  12.                     if f'{n1}{n2}' == f'{n3}{n4}':
  13.                         print("Cannot change the same player.")
  14.                     else:
  15.                         counter += 1
  16.                         print(f"{n1}{n2} - {n3}{n4}")
  17.                     if counter == 6:
  18.                         max_subs = True
  19.                         break
  20.             if max_subs:
  21.                 break
  22.         if max_subs:
  23.             break
  24.     if max_subs:
  25.         break
Advertisement
Add Comment
Please, Sign In to add comment