CF2164B Even Modulo Pair

Description

You are given a strictly increasing sequence of positive integers $ a_1 < a_2 < \ldots < a_n $ . Find two distinct elements $ x $ and $ y $ from the sequence such that $ x < y $ and $ y \bmod x $ is even, or determine that no such pair exists. $ p \bmod q $ denotes the remainder from dividing $ p $ by $ q $ .

Input Format

Each test contains multiple test cases. The first line contains the number of test cases $ t $ ( $ 1 \le t \le 2\cdot 10^4 $ ). The description of the test cases follows. The first line of each test case contains one integer $ n $ ( $ 2 \le n \le 10^5 $ ) — the length of the sequence. The second line of each test case contains $ n $ integers $ a_1,a_2,\ldots,a_n $ ( $ 1\le a_1 < \ldots < a_n\le 10^9 $ ) — the given sequence. It is guaranteed that the sum of $ n $ over all test cases does not exceed $ 10^5 $ .

Output Format

For each test case: - If no such pair exists, output -1. - Otherwise, output two integers $ x $ and $ y $ — the elements that satisfy the condition. If there are multiple valid pairs, you may output any of them.

Explanation/Hint

[Visualizer link](https://codeforces.com/assets/contests/2164/B_ohw7aeph4eewahwooF1N.html) In the first test case, choosing $ x = 3 $ and $ y = 5 $ yields $ y \bmod x = 5 \bmod 3 = 2 $ , which is even. In the third test case, it is clear that no valid pair exists.