#P16874. [GKS 2022 #B] Palindromic Factors
[GKS 2022 #B] Palindromic Factors
Problem Description
You are given a positive integer . Find the number of factors of which are palindromes. A number is called a palindrome if it remains the same when the digits in decimal representation are reversed. For instance, is a palindrome, while is not.
Input Format
The first line of the input gives the number of test cases, . lines follow.
Each line represents a test case and contains a single integer .
Output Format
For each test case, output one line containing Case #: , where is the test case number (starting from ) and is the number of factors of which are palindromes.
4
6
10
144
242
Case #1: 4
Case #2: 3
Case #3: 7
Case #4: 6
Hint
In the first test case, has factors which are palindromes: , , , and .
In the second test case, has factors which are palindromes: , , and .
In the third test case, has factors which are palindromes: , , , , , , and .
In the fourth test case, has factors which are palindromes: , , , , , and .
Limits
.
Test Set
.
Test Set
.