CF2037B.Intercepted Inputs

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Intercepted Inputs

To help you prepare for your upcoming Codeforces contest, Citlali set a grid problem and is trying to give you a nn by mm grid through your input stream. Specifically, your input stream should contain the following:

  • The first line contains two integers nn and mm — the dimensions of the grid.
  • The following nn lines contain mm integers each — the values of the grid.

However, someone has intercepted your input stream, shuffled all given integers, and put them all on one line! Now, there are kk integers all on one line, and you don't know where each integer originally belongs. Instead of asking Citlali to resend the input, you decide to determine the values of nn and mm yourself.

Output any possible value of nn and mm that Citlali could have provided.

Input

The first line contains an integer tt (1t1041 \leq t \leq 10^4) — the number of test cases.

The first line of each test case contains an integer kk (3k21053 \leq k \leq 2 \cdot 10^5) — the total number of inputs in your input stream.

The following line of each test case contains kk integers a1,a2,,aka_1, a_2, \ldots, a_k (1aik1 \leq a_i \leq k) — the shuffled inputs of your input stream. It is guaranteed that nn and mm are contained within the kk integers.

It is guaranteed that the sum of kk over all test cases does not exceed 21052 \cdot 10^5.

Output

For each test case, output two integers, one possible value of nn and mm. If multiple possible answers exist, output any.

Note

In the first test case, the initial input could have been the following:

1 1

2

In the second test case, the initial input could have been the following:

3 3

4 5 6

7 8 9

9 10 11

Samples

5
3
1 1 2
11
3 3 4 5 6 7 8 9 9 10 11
8
8 4 8 3 8 2 8 1
6
2 1 4 5 3 3
8
1 2 6 3 8 5 5 3
1 1
3 3
2 3
4 1
1 6

在线编程 IDE

建议全屏模式获得最佳体验