Given a number N, our task is to find the closest Palindrome number whose absolute difference with given number is minimum. If 2 Palindome numbers have same absolute difference from the given number, then output the smaller one.
The first line of the input contains integer T denoting the number of test cases. Each test case contains a number N.
For each test case, the print the closest palindrome number.
Note: If the difference of two closest palindromes numbers is equal then we print smaller number as output.
Test Case 1: Smallest closest palindrome number is 9.
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.