| Abakoda Long Contest 2022 |
|---|
| Finished |
In the digital world, there's only three things to do.
Hello virtual reality! Bob is excited to surf on the wild and wacky place known as the World Wide Web! He's already watched the thorough tutorial that will teach a cool kid like him all about how to navigate the cyberspace. The only thing left is that he needs a username!
Unfortunately, his preferred username of bobTheBuilder has already been taken. So, as is customary, Bob is going to append a number to the end of his username. But not just any number—Bob wants it to be a positive integer, and he wants to take into account the digital style of this number. Furthermore, the number itself cannot be too small or too large.
The digital style of a positive integer $$$n$$$ is merely the product of its digits. So, for example, the digital style of $$$1984$$$ is $$$1 \times 9 \times 8 \times 4 = 288$$$.
But Bob's a contrarian, you see. He actually wants to minimize his digital style, because he thinks not being cool is the new cool thing (as long as you do it ironically). Given positive integers $$$L$$$ and $$$R$$$, what is the minimum possible digital style among all integers $$$n$$$ such that $$$L \leq n \leq R$$$?
Input consists of a single line containing the two space-separated integers $$$L$$$ and $$$R$$$.
$$$$$$\begin{align*}
&\begin{array}{|c|c|l|} \hline \text{Subtask} & \text{Points} & \text{Constraints} \\ \hline 1 & \mathbf{34} & 1 \leq L \leq R \leq 10^{4} \\ \hline 2 & \mathbf{33} & 1 \leq L \leq R \leq 10^{9} \\ \hline 3 & \mathbf{33} & 1 \leq L \leq R \leq 10^{18} \\ \hline \end{array}\\
\end{align*}$$$$$$
Output a single integer, the minimum possible digital style across all integers in the given range.
42 47
8
225 228
20
| Name |
|---|


