Advertisement
ALEXANDAR_GEORGIEV

challenge_the_wedding

Jun 10th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. count_man = int(input())
  2. count_women = int(input())
  3. max_tables = int(input())
  4. list_couples = []
  5. check_tables = False
  6. # Комбинациите са с максимален размер, брой маси
  7. for man in range(1, count_man + 1):
  8.     for woman in range(1, count_women + 1):
  9.         list_couples.append(str(man) + ' <-> ' + str(woman))
  10.         if len(list_couples) == max_tables:
  11.             check_tables = True
  12.             break
  13.     if check_tables:
  14.         break
  15. for couples in list_couples:
  16.     print(f"({couples})", end=' ')
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement