For this Question: Given an array of N integers and an integer K, your task is to calculate the count of pairs whose sum is divisible by K.The first line of input contains two integers N and K, the next line contains N space-separated integers depicting values of an array.

Constraints:-
1 < = N < = 100000
1 < = Arr[i] <= 100000
1 <= K <= 100000Print the count of required pairs.Sample Input
5 4
1 2 3 4 5

Sample Output
2

Sample Input
5 3
1 2 3 4 5

Sample Output
 4

Explanation:-
In Sample 2,
(1 5), (1 2), (2 4), and (4 5) are the required pairs, I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795

#define MOD 1000000007

#define read(type) readInt<type>()
#define max1 100001
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
signed main(){
  

    fast();
int n;
cin>>n;
int a;
int k;
cin>>k;
int fre[k];
FOR(i,k){
fre[i]=0;}
FOR(i,n){
cin>>a;
fre[a%k]++;
}
int ans=(fre[0]*(fre[0]-1))/2;
for(int i=1;i<=(k-1)/2;i++){
    ans+=fre[i]*fre[k-i];

}
if(k%2==0){
    ans+=(fre[k/2]*(fre[k/2]-1))/2;

}
out(ans);
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?