#x1019. CF913G Power Substring
CF913G Power Substring
Power Substring
题面翻译
给你一个长为 的正整数序列。
对于每个 ,你需要找到一个正整数 ,使得 (十进制)是 (十进制)最后 , 位的数字的一个子串。
不需要最小化 。
问题中的十进制不包含前导零。
,,正整数 必须满足 。 保证有解。
如果有多个答案,输出任意一个。
题目描述
You are given positive integers .
For every you need to find a positive integer such that the decimal notation of contains the decimal notation of as a substring among its last digits. Here is the length of the decimal notation of .
Note that you don't have to minimize . The decimal notations in this problem do not contain leading zeros.
输入格式
The first line contains a single integer ( ) — the number of integers .
Each of the next lines contains a positive integer ( ).
输出格式
Print lines. The -th of them should contain a positive integer such that the last digits of contain the decimal notation of as a substring. Integers must satisfy .
It can be shown that the answer always exists under the given constraints. If there are multiple answers, print any of them.
样例 #1
样例输入 #1
2
8
2
样例输出 #1
3
1
样例 #2
样例输入 #2
2
3
4857
样例输出 #2
5
20