AT_arc224_a.Attach 00
普及-
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Find the minimum value of a positive integer n satisfying the following two conditions.
- n is a multiple of K.
- In the decimal representation of n,
0appears two or more times consecutively.
T test cases are given; solve each of them.
求满足以下两个条件的最小正整数 n:
- n 是 K 的倍数;
- n 的十进制表示中,数字
0至少连续出现两次。
共给出 T 组测试用例,请对每组用例求解。
输入格式
The input is given from Standard Input in the following format, where casei denotes the i-th test case:
T
case1
⋮
caseT
Each test case is given in the following format:
K
输入从标准输入给出,格式如下,其中 casei 表示第 i 个测试用例:
T
case1
⋮
caseT
每个测试用例的格式如下:
K
输出格式
Output T lines. The i-th line should contain the answer for the i-th test case.
输出 T 行。第 i 行应包含第 i 个测试用例的答案。
输入输出样例
输入#1
3 17 6801 998244353
输出#1
1003 34005 16970154001
说明/提示
Sample 1 Explanation:
This input contains three test cases.
For the first test case, the minimum value satisfying the conditions is 1003 (=17×59).
For the second test case, the minimum value satisfying the conditions is 34005 (=6801×5). Note that 20403 (=6801×3) does not satisfy the condition.
For the third test case, the minimum value satisfying the conditions is 16970154001 (=998244353×17). As this shows, the answer may not fit in a 32-bit integer.
Constraints
- 1≤T≤105
- 1≤K≤109
- All input values are integers.
样例 1 解释:
该输入包含三个测试用例。
对于第一个测试用例,满足条件的最小值为 1003 (=17×59)。
对于第二个测试用例,满足条件的最小值为 34005 (=6801×5)。注意,20403 (=6801×3) 不满足条件。
对于第三个测试用例,满足条件的最小值为 16970154001 (=998244353×17)。如本例所示,答案可能无法用 32 位整数表示。
约束条件
- 1≤T≤105
- 1≤K≤109
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?