Competitive programmers have a rating, expressed as an integer (possibly negative). A school wants to send three-member teams to the national team contest, and the organizers ask that every team is balanced: the total rating of each team must be zero. Given the ratings of all competitors from one school, your task is to determine in how many ways the school can pick its team.
Formally, you are counting the ways to choose three different competitors whose ratings sum to .
Input
The first line contains a single integer - the number of testcases.
- The first line of each testcase contains an integer - the number of competitors.
- The next line contains pairwise different integers - their ratings.
Output
For every testcase print a single line with the number of possible teams whose total rating is zero.
Example
1 9 -8 -5 7 4 1 -2 9 -3 2
4
The teams are , , and .
Constraints
This problem was adapted, with permission, from Trojke datog zbira (3sum), authored by Društvo matematičara Srbije and Fondacija Petlja.