This is my code. This got AC but with 31 marks. Please help me by telling how can I get the remaining 69 marks too with this code. What additions should I do ?I have provided the code here or you can check my submitted solution here - CodeChef: Practical coding for everyone
#include<bits/stdc++.h>
#define fr(a,n) for(long long i=a;i<n;i++)
using namespace std;
int main(){
ios::sync_with_stdio(0);
int t;long long int c,n,k,j,min,count;
cin>>t;
while(t--){
count = 0;
cin>>n>>k;
vector<long long int> a(2*(n+5));
fr(0,n)
cin>>a[i];
min=abs(a[0]+a[1]-k);
fr(0,n-1){
for(j=i+1;j<n;j++){
c=abs(a[i]+a[j]-k);
if(min>=c){
min=c;
count++;
}
}
}
cout<<min<<" "<<count<<endl;
}
return 0;
}