在区间 $[a, b]$ 中找到一个数字,使其各位数字之积最大。
输入格式
第一行包含两个正整数 $a$ 和 $b$ ($1 \le a \le b \le 10^{18}$),表示区间的左端点和右端点。
输出格式
输出区间 $[a, b]$ 中各位数字之积最大的那个数。如果存在多个可能的答案,输出其中任意一个即可。
样例
样例输入 1
1 10
样例输出 1
9
样例输入 2
51 62
样例输出 2
59
在区间 $[a, b]$ 中找到一个数字,使其各位数字之积最大。
第一行包含两个正整数 $a$ 和 $b$ ($1 \le a \le b \le 10^{18}$),表示区间的左端点和右端点。
输出区间 $[a, b]$ 中各位数字之积最大的那个数。如果存在多个可能的答案,输出其中任意一个即可。
1 10
9
51 62
59
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: