#K66317. Next Palindrome Finder
Next Palindrome Finder
Next Palindrome Finder
Given a list of integers, your task is to find the smallest palindrome number that is greater than or equal to each given integer. A palindrome is a number which reads the same backward as forward. For example, the number 121 is a palindrome, while 123 is not. If the given number is already a palindrome, then it is the answer for that integer.
Mathematically, for an integer \(n\), find the minimum \(p\) such that \(p \geq n\) and \(p\) is a palindrome. For instance, when \(n = 123\), the answer is \(131\) since it is the smallest palindrome \(\geq 123\).
inputFormat
The first line contains a single integer \(T\) denoting the number of test cases. Each of the next \(T\) lines contains one integer \(n\).
Constraints: \(0 \le n \le 10^9\).
outputFormat
For each test case, output a single integer which is the smallest palindrome greater than or equal to \(n\). The outputs for different test cases should be printed in one line separated by a space.
## sample1
121
121
</p>