Highest single digit divisor

Find the highest single digit divisor for all numbers in the given range [l, r].
The input contains two space-separated numbers land r. Your task is to print the highest single digit divisors for all numbers in the range [l, r] on separate lines.
Input
Output
36 42
9 1 2 3 8 1 7
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue