This is the easy version of the problem. The only difference is that in this version k = 0.

There is an array a_1, a_2, …, a_n of n positive integers. You should divide it into a minimal number of continuous segments, such that in each segment there are no two numbers (on different positions), whose product is a perfect square.

Moreover, it is allowed to do at most k such operations before the division: choose a number in the array and change its value to any positive integer. But in this version k = 0, so it is not important.

What is the minimum number of continuous segments you should use if you will make changes optimally?

Input

The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases.

The first line of each test case contains two integers n, k (1 ≤ n ≤ 2 ⋅ 10^5, k = 0).

The second line of each test case contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^7).

It's guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case print a single integer — the answer to the problem.

Example

Input


3
5 0
18 6 2 4 1
5 0
6 8 1 24 8
1 0
1


Output


3
2
1

Note

In the first test case the division may be as follows:

  * [18, 6] 
  * [2, 4] 
  * [1] 
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class First {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.call(in,out);
        out.close();

    }

    static class TaskA {
        int[] arr = new int[10000005];
        public void call(InputReader in, PrintWriter out) {

            sieve();

            int t;
            t = in.nextInt();
            //t = 1;
            while (t > 0) {
                //out.print("Case #"+(a++)+": ");

                int n, k;
                n = in.nextInt();
                k = in.nextInt();


                int[] array = new int[n];
                int[] a = new int[n];
                int b, c, count, d;
                for (int i = 0; i < n; i++) {
                    array[i] = in.nextInt();
                    b = array[i];
                    c = 0;
                    count = 0;
                    d = 1;
                    while (b != 1) {
                        if (arr[b] != c) {
                            if (count % 2 != 0) {
                                d *= c;
                            }
                            count = 0;
                            c = arr[b];
                        }
                        b /= arr[b];
                        count++;
                    }
                    if (count % 2 != 0) {
                        d *= c;
                    }
                    a[i] = d;
                }

                Map<Integer, Queue<Integer>> map = new HashMap<>();
                for (int i = 0; i < n; i++) {
                    if (map.getOrDefault(a[i], null) == null) {
                        map.put(a[i], new LinkedList<>());
                    }
                    map.get(a[i]).add(i);
                }
                long ans = 0;
                int min = Integer.MAX_VALUE;
                for (int i = 0; i < n; i++) {
                    map.get(a[i]).poll();
                    if (map.get(a[i]).size() != 0) {
                        min = Math.min(map.get(a[i]).peek(), min);
                    }
                    if (i == min) {
                        ans++;
                        min = Integer.MAX_VALUE;
                        if (map.get(a[i]).size() != 0) {
                            min = Math.min(map.get(a[i]).peek(), min);
                        }
                    }
                }


                out.println(ans + 1);


                t--;

            }
        }
        public void sieve(){

            for (int i = 2; i < arr.length; i++) {
                if(arr[i]==0){
                    for (int j = i; j < arr.length; j+=i) {
                        if(arr[j]==0)
                            arr[j] = i;
                    }
                }
            }
        }

    }

    static int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }

    static int lcm(int a, int b)
    {
        return (a / gcd(a, b)) * b;
    }

    static class answer implements Comparable<answer>{
        int a;
        int b;

        public answer(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(answer o) {
            return o.a - this.a;
        }

        @Override
        public boolean equals(Object o){
            if(o instanceof answer){
                answer c = (answer)o;
                return a == c.a && b == c.b;
            }
            return false;
        }
    }

    static class answer1 implements Comparable<answer1>{
        int a, b, c;

        public answer1(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;

        }

        @Override
        public int compareTo(answer1 o) {
            if(o.c==this.c){
                return this.a - o.a;
            }
            return o.c - this.c;
        }
    }

    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static void sort(long[] a) {
        ArrayList<Long> l=new ArrayList<>();
        for (Long i:a) l.add(i);
        l.sort(Collections.reverseOrder());
        for (int i=0; i<a.length; i++) a[i]=l.get(i);
    }

    static final Random random=new Random();

    static void shuffleSort(int[] a) {
        int n=a.length;
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong(){
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }
}