409539: GYM103627 C AND PLUS OR
Description
For two nonnegative integers $$$a, b$$$, let $$$a \wedge b$$$ be their bitwise AND, and $$$a \vee b$$$ be their bitwise OR.
You are given an array $$$A_0, A_1, \ldots, A_{2^N - 1}$$$ of length $$$2^N$$$ consisting of nonnegative integers. Please find a pair of indices $$$0 \le i, j \le 2^N - 1$$$ such that $$$A_{i} + A_{j} < A_{i \wedge j} + A_{i \vee j}$$$, or state that no such pair exists. If there is more than one such pair, find any one of them.
InputThe first line contains an integer $$$N$$$ ($$$0 \leq N \leq 20$$$).
The second line contains $$$2^N$$$ integers: $$$A_0, A_1, \ldots, A_{2^N - 1}$$$ ($$$0 \leq A_i \leq 10^7$$$).
OutputIf there is an answer, output two integers $$$i$$$ and $$$j$$$ denoting the answer. The numbers $$$i$$$ and $$$j$$$ should be in the range $$$[0, 2^N - 1]$$$. Otherwise, output -1.
ExamplesInput2 0 1 1 2Output
-1Input
2 0 1 1 3Output
2 1Input
0 100Output
-1