Do You Know Your ABCs?
Farmer John's cows have been holding a daily online gathering on the "mooZ" video meeting platform. For fun, they have invented a simple number game to play during the meeting to keep themselves entertained.
Elsie has three positive integers . These integers are supposed to be secret, so she will not directly reveal them to her sister Bessie. Instead, she tells Bessie distinct integers , claiming that each is one of . However, Elsie may be lying; the integers might not correspond to any valid triple .
This is too hard for Bessie to wrap her head around, so it is up to you to determine the number of triples that are consistent with the numbers Elsie presented (possibly zero).
Input
The first line contains the number of test cases .
Each test case starts with , the number of integers Elsie gives to Bessie.
The second line of each test case contains distinct integers .
Output
For each test case, output the number of triples that are consistent with the numbers Elsie presented.
Examples
For , the five possible triples are as follows: .