BNY Mellon OA

You are given a sequence A1,A2,…,AN. For each valid i, the star value of the element Ai is the number of valid indices j<i such that Aj is divisible by Ai.
Edited : find maximum star value.

Example Input
1
7
8 1 28 4 2 6 7
Example Output
3
Explaination : A5=2 divides 4, 28 and 8, so its star value is 3. There is no element with a higher star value.
1≤T≤10
1≤N≤10^5
1≤Ai≤10^6