题目描述
Consider number of the form
a
a...awhere 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 = 3
3and 16 =
2
22are numbairs. Number 1 is, too, a numbair since 1 = 1
1. 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 ≤ 10
9).
输出
For each test case, print a single line containing an integer, denoting the number of numbairs not
exceeding n.