問題描述 :
Give you a binary string, you can add some 1s or 0s at any places of the string. Then the result divide by K, and the remainder should be zero. Please print string of the result, if there are more, print the one with the smallest length, if still more, print the smallest lexicographical one. If there is no such result print impossible.
輸入:
No more than 10 test cases. For each test case first line is a nonempty binary string whose length is no more than 20 and without leading zeros. Next line is an integer K(1 <= K <= 200).
輸出:
No more than 10 test cases. For each test case first line is a nonempty binary string whose length is no more than 20 and without leading zeros. Next line is an integer K(1 <= K <= 200).
樣例輸入:
1000
4
11101
34
11010
70
樣例輸出:
1000
10101010
11010010
http://www.acmerblog.com/hdu-2847-binary-string-4490.html