Sichanov

subs

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