Continuous Digit

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2867
64-bit integer IO format: %I64d      Java class name: Main

Description

We define f(m,k,n) is the value of the nth number which has m continuous digit k. For example, f(3,6,1)=666,f(3,6,2)=1666,f(3,6,3)=2666,....
Now give you m,k,n and ask you to solve f(m,k,n).

Input

Input contains multiple cases each presented on a separate line. Each line contains three integer numbers m,k,n(2<=m<=10,1<=k<=9,1<=n<=1000000000).

Output

For each test case, your program should output the value of f(m,k,n).

Sample Input

3 6 187

Sample Output

66666

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .