CF1835C Twin Clusters
Description
Famous worldwide astrophysicist Mleil waGrasse Tysok recently read about the existence of twin galaxy clusters. Before he shares this knowledge with the broader audience in his podcast called S.tarT-ok, he wants to prove their presence on his own. Mleil is aware that the vastness of the universe is astounding (almost as astounding as his observation skills) and decides to try his luck and find some new pair of twin clusters.
To do so, he used his TLEscope to observe a part of the night sky that was not yet examined by humanity in which there are exactly $ 2^{k + 1} $ galaxies in a row. $ i $ -th of them consist of exactly $ 0 \le g_i < 4^k $ stars.
A galaxy cluster is any non-empty contiguous segment of galaxies. Moreover, its' trait is said to be equal to the [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of all values $ g_i $ within this range.
Two galaxy clusters are considered twins if and only if they have the same traits and their corresponding segments are disjoint.
Write a program that, for many scenarios, will read a description of a night sky part observed by Mleil and outputs a location of two intervals belonging to some twin clusters pair, or a single value $ -1 $ if no such pair exists.
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the first test case we pick intervals $ [2, 4] $ and $ [6, 6] $ as our twin clusters. The trait of the first interval equals $ 15 \oplus 0 \oplus 7 = 8 $ , and the trait of the second interval equals $ 8 $ , so these galaxy clusters are indeed twins.