N people are standing in a row. Each of them has been assigned a rating of x and a range value y. A person with a range value of y has access to ratings of the first y person standing in front of him.
For each person, determine the count of unique prime factors of his or her rating x that divides any of the ratings of the person standing in his range.
Note: For each person, their range value is always less than or equal to the number of people standing in front of him.
Input format
Output format
For each person, print the count of unique prime factors of his or her rating x that divides any of the ratings of the person standing in his or her range.
Constraints
1≤N≤1001≤x≤1000≤y<i1≤i≤N
For the person at position i = 1, the range value is 0 so the answer is 0.
For the person at position i = 2, the range value is 1. The prime factor 3 does not divide 7 so the answer is 0.
For the person at position i = 3, the range value is 1. The prime factors of 6 are {2,3}, 3 divides 3 ,but 2 does not divide 3 so the answer is 1.
For the person at position i = 4, the range value is 1. The prime factor 3 divides 6 so the answer is 1.
For the person at position i = 5, the range value is 4. The prime factor 7 divides 7 so the answer is 1.