← Home
write a go solution for C. Serval and The Formulatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output You are given two positive integers x and y (1<=x,y<=10^9).Find a non-negative integer k<=10^18, such that (x+k)+(y+k)=(x+k)oplus(y+k) holds^∗, or determine that such an integer does not exist.^∗oplus denotes the bitwise XOR operation. InputEach test contains multiple test cases. The first line contains the number of test cases t (1<=t<=10^4). The description of the test cases follows. The only line of each test case contains two integers x and y (1<=x,y<=10^9) — the given integers.OutputFor each test case, output a single integer k (0<=k<=10^18) — the integer you found. Print -1 if it is impossible to find such an integer.If there are multiple answers, you may print any of them.ExampleInput52 56 619 101024 40961198372 599188Output0
-1
1
1024
28
NoteIn the first test case, since (2+0)+(5+0)=(2+0)oplus(5+0)=7, k=0 is a possible answer. Note that k=4 is also a possible answer because (2+4)+(5+4)=(2+4)oplus(5+4)=15.In the second test case, (x+k)oplus(y+k)=(6+k)oplus(6+k)=0. However, (x+k)+(y+k)>0 holds for every k>=0, implying that such an integer k does not exist.. Output only the code with no comments, explanation, or additional text.