Submit | All submissions | Best solutions | Back to list |
SIMPLPRBLM - A Simple Problem |
Given an array of integers A[] and a number S, find the number of pairs of integers in the array whose sum is equal to S.
Input
Input starts with an integer T (1 ≤ T ≤ 50), denoting the number of test cases.
Each case starts with a line containing two integers n (1 ≤ n ≤ 105) and S (1 ≤ S ≤ 1010). The next line contains n integers, denoting A1, A2 ... An (1 ≤ Ai ≤ 109).
Output
For each case, print the case number and the number of ways S can be made. Be careful as the result can be a large number.
Example
Input: 3 4 8 1 2 4 9 3 7 3 4 4 3 8 4 4 4 Output: Case 1: 0 Case 2: 2 Case 3: 3
Added by: | Sarwar |
Date: | 2018-05-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |