We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- ProjectEuler+
- Project Euler #4: Largest palindrome product
Project Euler #4: Largest palindrome product
Project Euler #4: Largest palindrome product
This problem is a programming version of Problem 4 from projecteuler.net
A palindromic number reads the same both ways. The smallest 6 digit palindrome made from the product of two 3-digit numbers is .
Find the largest palindrome made from the product of two 3-digit numbers which is less than .
Input Format
First line contains that denotes the number of test cases. This is followed by lines, each containing an integer, .
Constraints
Output Format
Print the required answer for each test case in a new line.
Sample Input 0
2
101110
800000
Sample Output 0
101101
793397
Explanation 0
- is product of and .
- is product of and .