← Home
write a go solution for Description:
Mihai and Slavic were looking at a group of n frogs, numbered from 1 to n, all initially located at point 0. Frog i has a hop length of a_i.

Each second, frog i hops a_i units forward. Before any frogs start hopping, Slavic and Mihai can place exactly one trap in a coordinate in order to catch all frogs that will ever pass through the corresponding coordinate.

However, the children can't go far away from their home so they can only place a trap in the first n points (that is, in a point with a coordinate between 1 and n) and the children can't place a trap in point 0 since they are scared of frogs.

Can you help Slavic and Mihai find out what is the maximum number of frogs they can catch using a trap?

Input Format:
The first line of the input contains a single integer t (1<=t<=100) — the number of test cases. The description of test cases follows.

The first line of each test case contains a single integer n (1<=n<=2*10^5) — the number of frogs, which equals the distance Slavic and Mihai can travel to place a trap.

The second line of each test case contains n integers a_1,ldots,a_n (1<=qa_i<=q10^9) — the lengths of the hops of the corresponding frogs.

It is guaranteed that the sum of n over all test cases does not exceed 2*10^5.

Output Format:
For each test case output a single integer — the maximum number of frogs Slavic and Mihai can catch using a trap.

Note:
In the first test case, the frogs will hop as follows:

- Frog 1: 0to1to2to3tomathbfcolorred4to*s
- Frog 2: 0to2tomathbfcolorred4to6to8to*s
- Frog 3: 0to3to6to9to12to*s
- Frog 4: 0tomathbfcolorred4to8to12to16to*s
- Frog 5: 0to5to10to15to20to*s

In the second test case, Slavic and Mihai can put a trap at coordinate 2 and catch all three frogs instantly.. Output only the code with no comments, explanation, or additional text.