当前位置: 代码迷 >> 综合 >> 2017 ACM-ICPC 亚洲区(西安赛区)网络赛C. Sum
  详细解决方案

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

热度:59   发布时间:2023-11-04 05:32:57.0

题目

 

Define the function S(x) for xx 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.

样例输入 


样例输出

89999999999999999999999999

思路 直接输出233个9。因为任何正整数乘以9的数位和都是9的倍数

AC代码

#include <iostream>
using namespace std;
int main()
{int T,n;cin>>T;while(T--){cin>>n;for(int i=1;i<=233;i++){cout<<9;}cout<<endl;}return 0;
}