are given a cluster a comprising of n integers. How about we call a couple of files I, j great if 1≤i1 (where gcd(x,y) is the best normal divisor of x and y). Track down the most extreme number of good record sets on the off chance that you can reorder the cluster an in a self-assertive manner.
Correct answer will be upvoted else downvoted.
You are given a cluster a comprising of n integers.
How about we call a couple of files I, j great if 1≤i<j≤n and gcd(
Track down the most extreme number of good record sets on the off chance that you can reorder the cluster an in a self-assertive manner.
Input :The primary line contains a solitary integer t (1≤t≤1000) — the number of experiments. The principal line of the experiment contains a solitary integer n (2≤n≤2000) — the number of components in the exhibit.
The second line of the experiment contains n integers a1,a2,… ,an (1≤ai≤105). It is ensured that the amount of n over all experiments doesn't surpass 2000.
Output :For each experiment, output a solitary integer — the greatest number of good file sets in the event that you can reorder the cluster an in a subjective manner.
Step by step
Solved in 3 steps with 1 images