For this Question: Hawkeye has been assigned to eliminate n monsters, the i<sup>th</sup> of which is of type a<sub>i</sub>. In one move, he can do either of the following:

i. Shoot down atmost any k monsters. In other words, he can shoot down any set of monsters such that the size of that set is smaller than or equal to k.
ii. Shoot down all monsters of any one type.

Find the minimum number of moves it will take him to shoot down all the monsters.The first line contains one integer t — the number of test cases. Each test case consists of two lines. 
The first line contains two space-separated integers n and k.
The second line contains n space-separated integers a<sub>1</sub>, a<sub>2</sub> . . .  a<sub>n</sub>.

<b>Constraints:</b>
1 ≤ t ≤ 10<sup>5</sup>
1 ≤ k ≤ n ≤ 10<sup>5</sup>
1 ≤ a<sub>i</sub> ≤ n
The sum of n over all test cases does not exceed 10<sup>5</sup>. For each test case, print a single value - the minimum number of moves required.Sample input
3
7 2
1 2 3 4 4 4 4
5 3
1 2 3 1 2
5 3
5 5 5 5 5

Sample output
3
2
1

Explanation:
For the first test case, the minimum moves required is 3. One way to do so is that Hawkeye can first shoot monsters 1 and 2 in one move using the second operation. 
Then he can shoot down all monsters of type 4 using the first operation, followed by shooting monster 3 by either method., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {
        try {
            System.setIn(new FileInputStream("input.txt"));
            System.setOut(new PrintStream(new FileOutputStream("output.txt")));
        } catch (Exception e) {
            System.err.println("Error");
        }
        Cf cf = new Cf();
        cf.solve();
    }

static class Cf {
    InputReader in = new InputReader(System.in);
    OutputWriter out = new OutputWriter(System.out);
    int mod = (int)1e9+7;

    public void solve() {

        int t = in.readInt();
        while(t--!=0) {
            int n = in.readInt();
            int k = in.readInt();
            int max = 0;
            int arr1[] = new int[n];
            for(int i=0;i<n;i++) {
                int x = in.readInt();
                arr1[i]=x;
                if(x>max) {
                    max = x;
                }
            }

            int arr[] = new int[max+2];
            for(int i=0;i<n;i++) {
                int x = arr1[i];
                arr[x]++;

            }
            int killedwithsame = 0;
            int tobekilledwithk = 0;
            for(int i=0;i<max+1;i++) {
                if(arr[i]>=k) {
                    killedwithsame++;
                }else {
                    tobekilledwithk+=arr[i];
                }
            }
            int ans = killedwithsame;
            if(tobekilledwithk%k==0) {
                ans+=(tobekilledwithk/k);
            }else {
                ans+=(tobekilledwithk/k);
                ans+=1;
            }
            out.printLine(ans);
        }

    }

    public long findPower(long x,long n) {
        long ans = 1;
        long nn = n;
        while(nn>0) {
            if(nn%2==1) {
                ans = (ans*x) % mod;
                nn-=1;
            }else {
                x = (x*x)%mod;
                nn/=2;
            }
        }
        return ans%mod;
    }
    public static int log2(int x) {
        return (int) (Math.log(x) / Math.log(2));
    }


        private static class InputReader {
            private InputStream stream;
            private byte[] buf = new byte[1024];
            private int curChar;
            private int numChars;
            private SpaceCharFilter filter;

            public InputReader(InputStream stream) {
                this.stream = stream;
            }

            public int read() {
                if (numChars == -1) {
                    throw new InputMismatchException();
                }
                if (curChar >= numChars) {
                    curChar = 0;
                    try {
                        numChars = stream.read(buf);
                    } catch (IOException e) {
                        throw new InputMismatchException();
                    }
                    if (numChars <= 0) {
                        return -1;
                    }
                }
                return buf[curChar++];
            }

            public int readInt() {
                int c = read();
                while (isSpaceChar(c)) {
                    c = read();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                int res = 0;
                do {
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    res *= 10;
                    res += c - '0';
                    c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
            }

            public String readString() {
                int c = read();
                while (isSpaceChar(c)) {
                    c = read();
                }
                StringBuilder res = new StringBuilder();
                do {
                    res.appendCodePoint(c);
                    c = read();
                } while (!isSpaceChar(c));
                return res.toString();
            }

            public double readDouble() {
                int c = read();
                while (isSpaceChar(c)) {
                    c = read();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                double res = 0;
                while (!isSpaceChar(c) && c != '.') {
                    if (c == 'e' || c == 'E') {
                        return res * Math.pow(10, readInt());
                    }
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    res *= 10;
                    res += c - '0';
                    c = read();
                }
                if (c == '.') {
                    c = read();
                    double m = 1;
                    while (!isSpaceChar(c)) {
                        if (c == 'e' || c == 'E') {
                            return res * Math.pow(10, readInt());
                        }
                        if (c < '0' || c > '9') {
                            throw new InputMismatchException();
                        }
                        m /= 10;
                        res += (c - '0') * m;
                        c = read();
                    }
                }
                return res * sgn;
            }

            public long readLong() {
                int c = read();
                while (isSpaceChar(c)) {
                    c = read();
                }
                int sgn = 1;
                if (c == '-') {
                    sgn = -1;
                    c = read();
                }
                long res = 0;
                do {
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    res *= 10;
                    res += c - '0';
                    c = read();
                } while (!isSpaceChar(c));
                return res * sgn;
            }

            public boolean isSpaceChar(int c) {
                if (filter != null) {
                    return filter.isSpaceChar(c);
                }
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
            }

            public String next() {
                return readString();
            }

            public interface SpaceCharFilter {
                public boolean isSpaceChar(int ch);
            }
        }

        private static class OutputWriter {
            private final PrintWriter writer;

            public OutputWriter(OutputStream outputStream) {
                writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
            }

            public OutputWriter(Writer writer) {
                this.writer = new PrintWriter(writer);
            }

            public void print(Object... objects) {
                for (int i = 0; i < objects.length; i++) {
                    if (i != 0) {
                        writer.print(' ');
                    }
                    writer.print(objects[i]);
                }
                writer.flush();
            }

            public void printLine(Object... objects) {
                print(objects);
                writer.println();
                writer.flush();
            }

            public void close() {
                writer.close();
            }

            public void flush() {
                writer.flush();
            }
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?