For this Question: Given two arrays and an integer x. Calculate the minimum absolute difference between sum of pair of elements (one from each array) and the integer x.First line of input contains the length of the array N
Second line contains first array elements
Third line contains second array elements
Last line contains the value of x

Constraints:-
1<=N<=10000
1<=elements<=100000
1<=x<=100000Output a single line containing the minimum differenceSample Input:-
4
1 4 5 7
10 20 30 40
32

Sample Output:-
1

Explanation:
Required pair is 30,1., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define max1 10000001

int main(){


int n,q;
cin>>n;
int  a[n];
int  b[n];
long sum=LONG_MAX;
unordered_map<int,int> a1,a2;
for(int i=0;i<n;i++){
cin>>a[i];a1[a[i]]++;
}
for(int i=0;i<n;i++){
    cin>>b[i];
    a2[b[i]]++;
}
int x;
cin>>x;
sort(a,a+n);
sort(b,b+n);
int  c[2*n];
int i=0,j=0,k=0;


while(i!=n && j!=n){
    if(a[i]<b[j]){c[k]=a[i];k++;i++;}
    else{c[k]=b[j];j++;k++;}
}
while(i!=n){
    c[k]=a[i];
    k++;i++;
}

while(j!=n){
    c[k]=b[j];
    k++;j++;
}
i=0,j=2*n-1;
while(i<j){
    if((c[i]+c[j])>x){if(a1.find(c[i])==a1.end() && a1.find(c[j])==a1.end()){j--;continue;}
    else if(a2.find(c[i])==a2.end() && a2.find(c[j])==a2.end()){j--;continue;}
    sum=min(sum,(long)abs(x-(c[i]+c[j])));
    j--;}
    else{
        if(a1.find(c[i])==a1.end() && a1.find(c[j])==a1.end()){i++;continue;}
    else if(a2.find(c[i])==a2.end() && a2.find(c[j])==a2.end()){i++;continue;}
    sum=min(sum,(long)abs(x-(c[i]+c[j])));
    i++;
    }
}
cout<<sum<<endl;


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