sequence1

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5567
64-bit integer IO format: %I64d      Java class name: Main

Description

Given an array $a$ with length $n$, could you tell me how many pairs $(i,j)$ ( i < j ) for $abs(a_i-a_j) \ mod \ b = c$.

Input

Several test cases(about $5$)

For each cases, first come 3 integers, $n,b,c(1 \leq n \leq 100,0 \leq c < b \leq 10^9)$

Then follows $n$ integers $a_i ( 0 \leq a_i \leq 10^9)$

Output

For each cases, please output an integer in a line as the answer.

Sample Input

3 3 2
1 2 3
3 3 1
1 2 3

Sample Output

1
2

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .