There is an exhibit a1,a2,… ,an of n positive integers. You should isolate it into an insignificant number of persistent portions, with the end goal that in each fragment there are no two numbers (on various positions), whose item is an ideal square. Besides, it is permitted to do all things considered k such tasks before the division: pick a number in the exhibit and change its worth to any sure integer. In any case, in this form k=0, so it isn't significant.
Correct answer will be upvoted else downvoted. Computer science.
There is an exhibit a1,a2,… ,an of n positive integers. You should isolate it into an insignificant number of persistent portions, with the end goal that in each fragment there are no two numbers (on various positions), whose item is an ideal square.
Besides, it is permitted to do all things considered k such tasks before the division: pick a number in the exhibit and change its worth to any sure integer. In any case, in this form k=0, so it isn't significant.
What is the base number of persistent portions you should utilize if you will make changes ideally?
Input
The principal line contains a solitary integer t (1≤t≤1000) — the number of experiments.
The main line of each experiment contains two integers n, k (1≤n≤2⋅105, k=0).
The second line of each experiment contains n integers a1,a2,… ,an (1≤
It's reliable that the amount of n over all experiments doesn't surpass 2⋅105.
Output
For each experiment print a solitary integer — the response to the issue.
Step by step
Solved in 4 steps with 1 images