#arc174d. D - Digit vs Square Root
D - Digit vs Square Root
Score: points
问题陈述
解决以下问题,共 个测试用例。
给定一个整数 ,找出满足以下所有条件的整数 的数量:
- 设 。当 和 用十进制表示(没有前导零)时, 是 的前缀。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Solve the following problem for test cases.
Given an integer , find the number of integers that satisfy all of the following conditions:
- Let . When and are written in decimal notation (without leading zeros), is a prefix of .
Constraints
- is an integer such that .
- is an integer such that .
Input
The input is given from Standard Input in the following format:
Here, represents the integer for the -th test case.
Output
Print lines in total. The -th line should contain the answer for the -th test case as an integer.
Sample Input 1
2
1
174
Sample Output 1
1
22
This input contains two test cases.
- For the first test case, satisfies the conditions since .
- For the second test case, for example, satisfies the conditions since .