402812: GYM100886 G Maximum Product
Memory Limit:0 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
G. Maximum Producttime limit per test1 secondmemory limit per test256 mebibytesinputstandard inputoutputstandard output
Find the number from the range [a, b] which has the maximum product of the digits.
InputThe first line contains two positive integers a and b (1 ≤ a ≤ b ≤ 1018): the left and the right ends of the range.
OutputPrint the number with the maximum product of the digits from the range [a, b]. If there are several possible answers, print any one of them.
ExamplesInput1 10Output
9Input
51 62Output
59