Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- lines = []
- while True:
- if len(lines) == 2 * n:
- break
- lines.append(input().split(' ? '))
- # ["1 ? 2 ? 3 ? 4 ? 5", "1 ? 2 ? 3 ? 4 ? 5"] 1
- # [['1', '2', '3', '4', '5'], ['1', '2', '3', '4', '5']] 2
- suit_nums = [[] for i in range(n)]
- for i in range(1, len(lines)+1, 2):
- for num in lines[i]:
- if int(num) % 2 == 0 and num not in lines[i-1]:
- suit_nums[i // 2].append(num)
- for line in suit_nums:
- if line:
- print(" * ".join(line))
- else:
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement