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.
8 1 28 4 2 6 7
Explaination : A5=2 divides 4, 28 and 8, so its star value is 3. There is no element with a higher star value.