Advertisement
GeorgiLukanov87

Substitute_last

Apr 11th, 2022
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. K = int(input())
  2. L = int(input())
  3. M = int(input())
  4. N = int(input())
  5. printed = False
  6. counter_changes = 0
  7.  
  8. for a1 in range(K, 8 + 1):
  9.     if printed:
  10.         break
  11.     for a2 in range(9, L - 1, -1):
  12.         if printed:
  13.             break
  14.         for b1 in range(M, 8 + 1):
  15.             if printed:
  16.                 break
  17.             for b2 in range(9, N - 1, -1):
  18.  
  19.                 if a1 % 2 == 0 and b1 % 2 == 0 and a2 % 2 != 0 and b2 % 2 != 0:
  20.                     if a1 == b1 and a2 == b2:
  21.                         print("Cannot change the same player.")
  22.                     else:
  23.                         print(f"{a1}{a2} - {b1}{b2}")
  24.                         counter_changes += 1
  25.                     if counter_changes == 6:
  26.                         printed = True
  27.                         break
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement