Palindromic Factors

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

You are given a positive integer AA. Find the number of factors of AA which are palindromes. A number is called a palindrome if it remains the same when the digits in decimal representation are reversed. For instance, 121 is a palindrome, while 123 is not.

입력

The first line of the input gives the number of test cases, TT. TT lines follow.

Each line represents a test case and contains a single integer AA.

출력

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is the number of factors of AA which are palindromes.

제한

  • 1T1001≤T≤100.

힌트

In the first test case, AA has 44 factors which are palindromes: 11, 22, 33, and 66.

In the second test case, AA has 33 factors which are palindromes: 11, 22, and 55.

In the third test case, AA has 77 factors which are palindromes: 11, 22, 33, 44, 66, 88, and 99.

In the fourth test case, AA has 66 factors which are palindromes: 11, 22, 1111, 2222, 121121, and 242242.