问题1625--Numbairs

1625: Numbairs

时间限制: 1Sec 内存限制:256 MB
提交:47 解决:7
[ 状态] [ 讨论版] [ 提交] [命题人: ]
题目描述
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.
样例输入 Copy
1 5
样例输出 Copy
2
来源/分类