#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
ll n,m,c;
cin>>n>>m>>c;
map <ll,ll> a;
queue b;
for(int i=0;i<n;i++){
ll d;
cin>>d;
if(a[d]==0) b.push(d);
a[d]++;
}
ll total=0;
for(int i=0;i<n;i++){
ll x=b.front();
ll y= (m*x) + c;
total+=a[x]*a[y];
//if(a[y]!=0) total++;
b.pop();
}
cout<<total;
}
Is it due to exceeding limits of long long int?