Div. 7 solution codeforces
You are given an integer does not have any leading zeroes and is divisible by .. You have to change the minimum number of digits in it in such a way that the resulting number
If there are multiple ways to do it, print any of them. If the given number is already divisible by, leave it unchanged.
The first line contains one integer( ) — the number of test cases.
Then the test cases follow, each test case consists of one line containing one integer( ).
For each test case, print one integer without any leading zeroes — the result of your changes (i. e. the integer that is divisible byand can be obtained by changing the minimum possible number of digits in ).
If there are multiple ways to apply changes, print any resulting number. If the given number is already divisible by, just print it.
input Div. 7 solution codeforces
3 42 23 377
42 28 777
In the first test case of the example,is already divisible by , so there’s no need to change it.
In the second test case of the example, there are multiple answers —, or .
In the third test case of the example, other possible answers are cannot print or ., and . Note that you