P1602 Sramoc Problem
Description
After the employees finished sorting the chopsticks, they were about to deliver the takeout, but when they checked the order, they were stunned: there was no phone number, only a function $\text{Sramoc}(k,m)$ written down.
What is this? What does it mean? So the restaurant called in members of the senior advisory group, YQ, SC, and HQ. After extensive research, they found some information:
> $\text{Sramoc}(k,m)$ denotes the smallest positive integer, composed of the digits $0,1,2,\ldots,k-1$, that is divisible by $m$.
For example, when $k=2, m=7$, $\text{Sramoc}(2,7)=1001$. Naturally, the phone number is $1001$.
To send out the takeout as quickly as possible, the computer team members buried their heads and started computing this peculiar number.
Input Format
Two integers $k, m$.
Output Format
A single line, that phone number (the smallest number).
Explanation/Hint
For $100\%$ of the testdata, $2\le k\le 10$, $1\le m\le 10^3$.
Translated by ChatGPT 5