Company: Amazon
Difficulty: medium
You are given an array A of length N . You must count the number of distinct good arrays B of positive integers (B i > 0) of length N . An array B is called good if, for some integer k > 0 , both of the following hold: k × B 1 = A 1 k × B i ≤ A i for every 2 ≤ i ≤ N Note: only the arrays B need to be distinct, not the values of the integer k. Two different values of k that produce the same array B are counted once. As the number of good arrays can be large, print it modulo 10 9 + 7. Input Format The program reads from standard input. The first line contains a single integer N , the size of array A. The second line contains N space separated integers, the elements of array A. Output Format Print to standard output a single integer denoting the number of good arrays modulo 10 9 + 7, followed by a newline. Constraints 1 ≤ N ≤ 100 1 ≤ A i ≤ 10 9 Sample Input 1 3 1 2 3 Sample Output 1 6 Explanation. Since A 1 = 1, the only choice is k = 1 and B