#P2022. 有趣的数
有趣的数
Description
Consider the set of positive integers from to . Arrange the elements of the set in lexicographical order; for example, when , the order is: .
Define the position of among the numbers as ; for example, . Now, given integers and , find the smallest such that .
Input Format
The input file contains a single line with two integers and .
Output Format
Output a single line with the smallest . If no such exists, output .
2 4
11
100000001 1000000000
100000000888888879
Hint
Constraints
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号