For this Question: Given an array of N Books B[], where B[i] denotes the number of pages P in i'th book. Now you need to find the maximum number of distinct books (having a different number of pages) after removing K books from the array.The input line contains T, denoting the number of testcases. Each testcase contains two lines. First line contains N, number of books and K, number of books you need to remove. Second line contains N positive integers denoting the number of pages in ith book.

Constraints:
1 <= T <= 100
1 <= N <= 10^4
1 <= K <= N
1 <= B[i] <= 10^4You need to print the maximum number of distinct books.Sample Input:
2
7 3
5 7 5 5 1 2 2
6 4
1 2 3 4 5 6

Sample Output:
4
2

Explanation:
Testcase 1:
Remove 2 occurrences of books having 5 pages and 1 occurrence of book having 2 pages., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define max1 1000001
int a[max1];
int main(){
int t;
cin>>t;
while(t--){
    int n,k;
    cin>>n>>k;
    int arr;
    map<int,int> m;
    int cnt=0;
    for(int i=0;i<n;i++){
        cin>>arr;
        if(m.find(arr)!=m.end()){cnt++;}
        m[arr]++;
    }
    if(k<=cnt){cout<<m.size()<<endl;}
    else{cout<<m.size()-(k-cnt)<<endl;}



}
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?