School Accuracy: 23.65% Submissions: 9693 Points: 0
Given a number, reverse it and add it to itself unless it becomes a palindrome or number of iterations reach becom more than 5. If it becomes a palindrome then print that palindrome number, otherwise print -1.
Input: First line of the input contains an integer T denoting the number of test cases. Each test case has a single line containing a number.
Output: Corresponding to each test case, print the palindrome number or -1 as stated above.