Daffodil International University
Problem Link
//Please follow from main function
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, k, cnt=0;
cin>>n>>k;
vector<int>jora(n+5);
for(int i=0; i<n; i++){
cin>>jora[i];
}
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
if(i<j && (jora[i]+jora[j])%k==0)cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
0 Comments