REAYZCODETST  Coding Test
Great programmer “Tourist” is attending a coding test. In this test he is asked to solve an easy problem. The problem description is,
There is an array a consists of n integers and another nonnegative integer x. He need to find the number of pair (i, j) where i!=j & a_{i }– a_{j} = x.
As it is very easy for him, he gave you this problem and start trying another hard problem. Can you solve this for him?
Input
Input starts with an integer t (1 ≤ t ≤ 10), number of test case.
Each case contains two integer n (1 ≤ n ≤ 10^{5}), and x (0 ≤ x ≤ 10^{9}).
Next line contains n separated integers a_{i} (1 ≤ a_{i} ≤ 10^{9}).
Output
For each case, print the case number and the number of pairs which meet the above condition.
Example
Input:2
5 3
5 1 4 2 3
10 2
12 17 19 13 17 11 17 12 15 14 Output:Case 1: 2
Case 2: 10
hide comments
aadarsh45:
20190118 19:20:43
good question


sanchit_aga:
20190108 16:16:30
Not using long long in C++ cost me 2 WA 

supernanren:
20181105 17:44:59
@:D thanks for the comment, really helpful. 

vishalsingh17:
20181101 04:39:30
Be careful with implementation of binary search. 

abhay_17:
20181024 17:30:07
yes prakash1108 i hv written in correct format


prakash1108:
20181019 16:20:37
@abhay_17 check output format. 

abhay_17:
20181001 06:56:32
i don't know why i'm getting WA


:D:
20180930 01:45:45
The pairs (i,j) are ordered. That means that for test case below the result is 2 (not 1):


julkas:
20180929 18:19:08
@nadstratosfer Try x=0. 

nadstratosfer:
20180929 16:45:37
I don't understand why I'm getting WA in this simple problem. What case does my solution fail on?

Added by:  Nabil 
Date:  20180918 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 