Catch The Frogs

Author: Efat Sikder

Mihai and Slavic, two curious children, were gazing at a group of frogs numbered from 1 to n. Each frog had a hop length of 1 to Ai.

The frogs were all initially located at point 0, and each second, frog i would hop Ai units forward. Before any frogs started hopping, Slavic and Mihai could place exactly one trap in a coordinate in order to catch all frogs that would ever pass through the corresponding coordinate.

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

Slavic and Mihai wanted to catch as many frogs as possible, so they asked you for help. Can you help them 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.

  1. The first line of each test case contains a single integer n (1 ≤ n ≤ 2 ⋅ 105) - the number of frogs, which equals the distance Slavic and Mihai can travel to place a trap.
  2. The second line of each test case contains n integers Ai (1 ≤ Ai ≤ 109) - 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 ⋅ 105

Output Format

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

Samples

Input
7 5 1 2 3 4 5 3 2 2 2 6 3 1 3 4 9 10 9 1 3 2 4 2 3 7 8 5 1 10 8 7 11 6 8 12 4 4 8 10 9 11 9 12 1 7 2 5 8 10
Output
3 3 3 5 0 4 4
Limits
Language Time Memory
GNU C 11 1s 512MB
GNU C++ 14 1s 512MB
GNU C++ 11 1s 512MB
PHP 7 1s 1024MB
Java (OpenJDK 8) 1s 4096MB
Statistics
Login To Submit