#P2425. 小红帽的回文数
小红帽的回文数
Description
Little Red Riding Hood likes palindromic numbers, but numbers in real life are often not palindromes. Now she has numbers. She knows that each of these numbers is a palindrome in base (). For each number, find the smallest such base .
Input Format
The first line contains an integer (). Each of the next lines contains a number ().
Output Format
Output lines. Each line contains the required .
4
1
4
21
345332
2
3
2
114
Hint
in binary is , and in base is . in base is , and in base is .
Translated by ChatGPT 5
京公网安备 11011102002149号