luogu#P4884. 多少个 1?
多少个 1?
Problem Description
Given an integer and a prime number , find the smallest positive integer such that ( digits of ) .
In plain words: .
Input Format
The first line contains two integers, representing and .
Output Format
Output one integer, the smallest that satisfies the condition.
9 17
3
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, , , and is guaranteed to be prime.
Translated by ChatGPT 5