You are viewing a single comment's thread. Return to all comments →
using namespace std; int main(){
int n,k; cin>>n>>k; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int count=0; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if((a[i]+a[j])%k==0){ count++; } } } cout<<count<<endl;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Pairs Sum
You are viewing a single comment's thread. Return to all comments →
include
using namespace std; int main(){
}