#include #include #include using namespace std; int a[105]; int n,b,c; void input() { for(int i = 1 ; i <= n ; i ++) scanf("%d",a+i); int cnt = 0; for(int i = 1 ; i <= n ; i ++) { for(int j = i + 1 ; j <= n ;j ++) { int tmp = a[i] - a[j]; if(tmp < 0) tmp = -tmp; if(tmp%b == c) cnt ++; } } printf("%d\n",cnt); } void solve() { } int main(void) { //freopen("a.in","r",stdin); while(~scanf("%d %d %d",&n,&b,&c)) { input(); solve(); } }