prob-D-Another Problem
prob-D-Another Problem
Programming Contest
University of Science, VNU-HCM
October 25, 2020
Problem D
Another Problem
Time Limit: 1 seconds
Memory Limit: 1024 megabytes
Phidang thinks that the first problem to test the candidates is too
simple and easy. Therefore, he wants to give another problem with
numbers. The problem is as follows.
There are two extremely large numbers 𝑎 and 𝑏. Phidang asks the
candidates to compute the multiplication of all the numbers in the
interval [𝑎, 𝑏]. Let the result of the multiplication is 𝑥. Now, the
candidates have to do the following process to find the result.
3. Otherwise, repeat the process with 𝑥 is now the sum of all digits of 𝑥.
Input
The input contains two lines corresponding to the two numbers 𝑎 and (1 ≤ 𝑎 ≤ 𝑏 ≤ 10100 000 ,
each lies on one line.
Output
The output contains a single number, which is the result of the above process.