81 - ZOJ Monthly, July 2009 - C
Mathematics is always attractive. For example, Fourier Transform can split a normal function into parts with Sin function and Cos function, which shows magical properties. Log function can change a number in a huge range to a very small range. And Z-Transform can transform a complex signal into a new function to simplify the analysis.
Navi likes mathematics very much (Although he does not major in math). Especially he likes the Log function. Because with different base number chosen, a number n will be change to different number via function Log. What's more, he is currently considering numbers satisfying a special condition, which is, for a given number a, the number n is divisible by [Logan], where [n] means the greatest integer less then or equal to n.
Now Navi has generated some numbers and stored them in array a. He wants to find out the number of numbers n in interval [A, B] satisfying [Logain] is positive and n is divisible by [Logain], for all ai.
There will be no more than 20 cases.
One line per case, the number of numbers in [A, B] satisfying the condition above.
1 6 6 2 2 5 14 2 3
Author: ZHUANG, Junyuan
Source: ZOJ Monthly, July 2009