Please tell me what's wrong in my code in KMXOR in may cook-off?

Here is the link to my code:
https://www.codechef.com/viewsolution/18621346

try this test case and do let me know if there wasn’t any mistake…

Your code fails for this one
1
2 4

Your code gives
1 6
whereas each output number should be between 1 and 4

Thank you very much sir…

Thank you sir…

welcome :slight_smile: