Given an integer N, you have to tell all the proper divisors (all divisors except the no. itself) of the N in the sorted manner. You also have to perform XOR operation on all these divisors and print the corresponding result.
The first line of input contains an integer T, denoting the Test cases. Then T test cases follow. Each test case contains an integer N.
For each test case print 2 lines. In the first line print space separated values denoting the proper divisors of N. Then in the next line print the XOR of all the proper divisors of N.
1 ≤ T ≤ 110
1 ≤ N ≤ 1012
1 2 5
1 2 4
Test case 1 : 1 XOR 2 XOR 5 = 6
Test case 2 : 1 XOR 2 XOR 4 = 7
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.