#P13802. [SWERC 2023] Team selection
[SWERC 2023] Team selection
题目描述
:::align{center}
:::
Two team leaders get to assemble their teams by choosing team members among a set of players that are numbered from 1 to . The leaders take turns, each picking the player among the remaining ones, according to their ideas of which one of the remaining players would be the best addition to their teams.
Given the choices of the two leaders (the first team leader starts first), please compute the list of players in each team.
输入格式
The input consists of three lines. The first line contains the single integer . The second line contains space-separated integers representing the choices of the first team leader: during the turn, the first leader chose the remaining player. The third line contains space-separated integers representing the choices of the second team leader: during the turn, the second leader chose the remaining player.
Limits
- ;
- is multiple of 2;
- the choices of the team leaders are valid: at each step, they are between 1 and the number of remaining players (inclusive).
输出格式
The output should contain two lines, each containing space-separated integers. The first line should contain the list of the players chosen to become members of the first team, in the order they were chosen: the player was chosen during the turn. The second line should contain the list of the players chosen to become members of the second team, in the order they were chosen: the player was chosen during the turn.
4
1 1
2 1
1 2
3 4