Define the function S(x) for x is a positive integer. S(x) equals to the sum of all digit of the decimal expression of x. Please find a positive integer k that S(k∗x)%233=0.
Input Format
First line an integer T, indicates the number of test cases (T≤100). Then Each line has a single integer x(1≤x≤1000000) indicates i-th test case.
Output Format
For each test case, print an integer in a single line indicates the answer. The length of the answer should not exceed 2000. If there are more than one answer, output anyone is ok.
样例输入
1 1
样例输出
89999999999999999999999999
题目大意:S(x)为求x用十进制数表达时各个位置上的数之和,比如S(123)=1+2+3=6;现在让你输入一个x,求一个k使S(k*x)%233=0;
思路:很很很巧妙;S(9)=9=1*9 S(2*9)=1+8=9=1*9 S(3*9)=2+7=9=1*9;
S(99)=9+9=2*9 S(99*2)=1+9+8=18=9*2;
S(999)=9+9+9=27; S(999*3)=S(2997)=9*3
由上可以知道规律当99999....9(233个9)乘以任何一个数它的S都是233*9;
所以直接输出233个9就A了