#Lutece1039. Fabricate equation
Fabricate equation
Migrated from Lutece 1039 Fabricate equation
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given an integer , you need to find the minimal integer so that there exists a satisfying and the number of different digit between and is under decimal system.
For example: , you can find a so that and is due to and . But for minimization, we should let so that and can just be .
Input
Only one integer
Output
The minimal .
Samples
1
1
191
2
Resources
The 13th UESTC Programming Contest Preliminary