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)的值是一个数的十进制表示,所有位数之和。
现在S(k*x)%233=0;问你K的值是多少。
思路:
因为说了长度小于2000,最大的数为1000000,长度为7,7*233<2000,所以不管输入,直接输出233个1000000。
//
// main.cpp
// C
//
// Created by zc on 2017/9/16.
// Copyright © 2017年 zc. All rights reserved.
//
#include <iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main(int argc, const char * argv[]) {
int T;
scanf("%d",&T);
while(T--)
{
int n;
scanf("%d",&n);
for(int i=0;i<233;i++) printf("1000000");
printf("\n");
}
}