问题1625--Numbairs

1625: Numbairs

时间限制: 1 Sec  内存限制: 256 MB
提交: 47  解决: 7
[状态] [讨论版] [提交] [命题人:]
题目描述
Consider number of the form aa...a  where a is a positive integer that can appear in the notation
twice or more. Let us call such numbers numbairs (which stands for number + stairs). For instance,
both 27 = 33 and 16 = 22 are numbairs. Number 1 is, too, a numbair since 1 = 11. Find out how many
numbairs there are between 1 and a number n given to you (inclusive).
输入
The first line of the input contains an integer T(1 ≤ T ≤ 10000), denoting the number of test cases.
In each test case, there is an integer n(1 ≤ n ≤ 109).
输出
For each test case, print a single line containing an integer, denoting the number of numbairs not
exceeding n.
样例输入 Copy
1
5
样例输出 Copy
2
来源/分类