#P16874. [GKS 2022 #B] Palindromic Factors

    ID: 17120 Type: RemoteJudge 2000ms 1024MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>模拟2022枚举Google Kick Start

[GKS 2022 #B] Palindromic Factors

题目描述

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, 121121 is a palindrome, while 123123 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 #xx: yy, where xx is the test case number (starting from 11) and yy is the number of factors of AA which are palindromes.

4
6
10
144
242
Case #1: 4
Case #2: 3
Case #3: 7
Case #4: 6

提示

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.

Limits

1≤T≤1001 \le T \le 100.

Test Set 11

1≤A≤1031 \le A \le 10^3.

Test Set 22

1≤A≤10101 \le A \le 10^{10}.