Find the Vertices
Time limit2sMemory limit512 MB
An interactive-style task where a hidden edge between two vertices must be identified by querying the grader; input is fixed by the grader, not read.
- Level
Easy1 of 10
- Topics
- Graph, Implementation
- Solved
- No attempts yet
Problem
A graph with N vertices has a single hidden edge. This edge is an undirected edge connecting vertex A and vertex B.
Write a program that finds the numbers A and B of the two vertices joined by the hidden edge.
Input
The Sample Grader reads the following information from standard input. You must not read any input.
The first line contains a natural number T, the total number of test cases.
From the second line, T lines give information about the T test cases. Line (i+1) contains three natural numbers N, A, and B separated by spaces (1 ≤ i ≤ T).
Output
The Sample Grader writes the following information to standard output. You must not write any output.
Starting from the first line, the Sample Grader writes your answers for A and B over T lines, one pair per line.
Constraints
Every input satisfies the following conditions.
- 1 ≤ T ≤ 500
- 2 ≤ N ≤ 100
- 1 ≤ A ≤ N
- 1 ≤ B ≤ N
- A ≠ B