atcoder#ARC131A. [ARC131A] Two Lucky Numbers
[ARC131A] Two Lucky Numbers
Score : points
Problem Statement
Mr. AtCoder reads in the newspaper that today's lucky number is a positive integer and tomorrow's is a positive integer .
Here, he defines a positive integer that satisfies both of the following conditions as a super-lucky number.
- The decimal notation of contains as a contiguous substring.
- The decimal notation of contains as a contiguous substring.
Actually, under the Constraints of this problem, there is always a super-lucky number less than . Find one such number.
Constraints
- and have no leading
0
s. - All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print one super-lucky number less than . If multiple solutions exist, you may print any of them.
13
62
131
One super-lucky number is , because:
- contains as a substring. (-st through -nd characters)
- contains as a substring. (-nd through -rd characters)
Some other super-lucky numbers are , , and , which would also be accepted.
69120
824
869120
One super-lucky number is , because:
- contains as a substring. (-nd through -th characters)
- contains as a substring. (-th through -th characters)
The smallest super-lucky number is , but note that any lucky number with at most digits would be accepted.
6283185
12566370
6283185
When , is itself, and is itself. In such a case too, is a super-lucky number.