You are given an array of integers. Count the number of pairs whose sum is divisible by in the given array.
While repeating pairs will not be counted again. And we can’t make a pair using the elements
which are in the same position. e.g.: and will be considered as only one pair. For better
understand, you can look at the following example.
If we have an array of five integers — , then the valid pairs according to their position in the
array are .
The first line contains an integer — the number of sets of input data in the test. Input data sets must be processed independently, one after another.
Each input data set consists of two lines. The first line contains an integer — the size of
the array. The second line contains integers .
For each input, print the output in the format, ‘Case X: Y’ (here, is the test case number starting from and is the number of pairs whose sum is divisible by in the given array).
2 5 5 5 5 5 5 5 1 2 3 4 5
Case 1: 10 Case 2: 2