CF1110H Modest Substrings
Description
You are given two integers $ l $ and $ r $ .
Let's call an integer $ x $ modest, if $ l \le x \le r $ .
Find a string of length $ n $ , consisting of digits, which has the largest possible number of substrings, which make a modest integer. Substring having leading zeros are not counted. If there are many answers, find lexicographically smallest one.
If some number occurs multiple times as a substring, then in the counting of the number of modest substrings it is counted multiple times as well.
Input Format
N/A
Output Format
N/A
Explanation/Hint
In the first example, string «101» has modest substrings «1», «10», «1».
In the second example, string «111» has modest substrings «1» ( $ 3 $ times) and «11» ( $ 2 $ times).