Problem: You have sticks, numbered from to . The length of the -th stick is .
You want to choose exactly sticks out of the given sticks, and form a non-degenerate triangle out of them, using the sticks as the sides of the triangle. A triangle is called non-degenerate if its area is strictly greater than .
You have to calculate the number of ways to choose exactly sticks so that a triangle can be formed out of them. Note that the order of choosing sticks does not matter (for example, choosing the -st, -nd and -th stick is the same as choosing the -nd, -th and -st stick).
Input Format: The first line contains one integer () — the number of test cases.
Each test case consists of two lines:
- the first line contains one integer ();
- the second line contains integers ().
Additional constraint on the input: the sum of over all test cases does not exceed .
Output Format: For each test case, print one integer — the number of ways to choose exactly sticks so that a triangle can be formed out of them.
Note: In the first test case of the example, any three sticks out of the given can be chosen.
In the second test case of the example, you can choose the -st, -nd and -th stick, or the -st, -rd and -th stick.
In the third test case of the example, you cannot form a triangle out of the given sticks with lengths , and .