시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 256 MB | 41 | 22 | 12 | 40.000% |
There is a large chess tournament being held in your town, and you decide to go and have a look. Two teams A and B each consisting of n players face each other. Every player from team A will play a match against every player from team B. In the end, the team with the most wins will be declared the winner. (In case of a draw, both players receive 1/2 point.)
You don’t know which players are on which team, but you have meticulously crafted a list of all matches that have been played during the tournament. The only problem is that some players have played matches outside the tournament schedule, facing a player from their own team or possibly even a player from the opposing team, either for practice or for fun. Can you still tell which players belong to which team?
The input starts with a line containing an integer T, the number of test cases. Then for each test case:
Note that a pair of players may be listed more than once.
For every test case, output two lines:
2 2 4 1 3 2 4 3 4 1 2 3 21 1 2 1 3 1 3 1 4 1 5 1 6 2 3 2 3 2 4 2 5 2 6 2 6 3 4 3 5 3 5 3 6 4 5 4 5 4 6 5 6 5 6
1 1 4 10 1 2 3
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2015 Preliminaries B번