For this Question: Separate chaining technique in hashing allows us to use a linked list at each hash slot to handle the problem of collisions. That is, every slot of the hash table is a linked list, so whenever a collision occurs, the element can be appened as a node to the linked list at the slot.

In this question, we'll learn how to fill up the hash table using Separate chaining technique. You are given hash table size which you'll use to insert elements into their correct position in the hash table i.e.(arr[i]%hashSize). You are also given an array arr. The size of the array is denoted by sizeOfArray. You need to fill up the hash table using Separate chaining and print the resultant hash table.The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains 2 lines of input. The first line contains size of the hashtable and the size of the array. The next line contains elements of the array

Constraints:
1 <= T <= 100
2 <= hashSize <= 10^3
1 <= sizeOfArray <= 10^3
0 <= arr[i] <= 10^7For each testcase, in a new line, print the hash table. You need to print the hash table as represented in the example.

Note: Please print tilde ( '~') character at the end of every testcase for separation of list from one another. Given below in the example represent to how to separate each testcase by tilde character.Sample Input:
2
10 6
92 4 14 24 44 91
10 5
12 45 36 87 11

Sample Output:
1->91
2->92
4->4->14->24->44
~
1->11
2->12
5->45
6->36
7->87
~

Explanation:
Testcase1: 92%10=2 so 92 goes to slot 2. 4%10=4 so 4 goes to slot 4. 14%10=4. But 4 is already occupied so we make a linked list at this position and add 14 after 4 in slot 4 and so on.
Testcase2: 12%10=2 so 12 goes to slot 2. 45%10=5 goes to slot 5. 36%10=6 goes to slot 6. 87%10=7 goes to slot 7 and finally 11%10=1 goes to slot 1., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define max1 1000001
int main(){

int t;
cin>>t;
while(t--){
        int n,m,x;
cin>>m>>n;
vector<int> a[m];
for(int i=0;i<n;i++){
cin>>x;
a[x%m].push_back(x);
}
for(int i=0;i<m;i++){
    if(a[i].size()==0){continue;}
    cout<<i<<"->";
for(int j=0;j<a[i].size()-1;j++){
    cout<<a[i][j]<<"->";
}
cout<<a[i][a[i].size()-1]<<endl;
}
cout<<"~"<<endl;

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