2017 ACM-ICPC 亚洲区(西安赛区)网络...

Define the function S(x)S(x) for xx is a positive integer. S(x)S(x) equals to the sum of all digit of the decimal expression of xx. Please find a positive integer kk that S(k*x)\%233=0S(kx)%233=0.

Input Format

First line an integer TT, indicates the number of test cases (T \le 100T100). Then Each line has a single integer x(1 \le x \le 1000000)x(1x1000000) 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 20002000. If there are more than one answer, output anyone is ok.

样例输入

1
1

样例输出

89999999999999999999999999
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        int n;
        scanf("%d",&n);
        int i;
        for(i=1;i<=233;i++)
            printf("%d",(int)233/n);
        printf("\n");
    }
    return 0;
}

what fuck?
posted @ 2017-09-16 16:14  衣带渐宽、为伊憔悴  阅读(147)  评论(0编辑  收藏  举报