FZU1068
:An Interesting Set
时间限制:1000MS
内存限制:32768KByte
64位IO格式:%I64d & %I64u
描述
Thomas, a mathematician, is interested in a set S consisting of positive integers. Set S is defined as follows:
(1) If a positive integer satisfies the property that the sum of all digits of it is equal to the product of them, then it belongs to S.
(2) If m belongs to S, then 2m belongs to S.
Thomas wants to find out the Kth smallest integer in set S. Design a program to solve the problem.
输入
The first line in the input is an integer N representing the number of test cases. The following N lines are N test cases and each line contains an integer K (1<=K<=500).
输出
For each test case, output a line containing an integer that is the Kth smallest integer in set S.
样例输入
样例输出
题目来源
FJNUPC 2005
2017-2025 台州市非普软件技术有限公司,浙江省台州市君悦大厦B幢1603室