#P1602. Sramoc 问题

Sramoc 问题

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 Sramoc(k,m)\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:

Sramoc(k,m)\text{Sramoc}(k,m) denotes the smallest positive integer, composed of the digits 0,1,2,,k10,1,2,\ldots,k-1, that is divisible by mm.

For example, when k=2,m=7k=2, m=7, Sramoc(2,7)=1001\text{Sramoc}(2,7)=1001. Naturally, the phone number is 10011001.

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,mk, m.

Output Format

A single line, that phone number (the smallest number).

2 7

1001

Hint

For 100%100\% of the testdata, 2k102\le k\le 10, 1m1031\le m\le 10^3.

Translated by ChatGPT 5