AT_arc223_c [ARC223C] Whole Product of Pairwise Distances
Description
You are given a sequence $ A $ of $ N $ positive integers.
Find the remainder when $ \prod_{1 \leq i < j \leq N}|A_i-A_j| $ is divided by $ N $ .
Solve $ T $ test cases per input.
Input Format
The input is given from Standard Input in the following format:
> $ T $ $ \mathrm{case}_1 $ $ \mathrm{case}_2 $ $ \vdots $ $ \mathrm{case}_T $
Each test case $ \mathrm{case}_t $ is given in the following format:
> $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $
Output Format
Output the answers over a total of $ T $ lines. The $ t $ -th line should contain the answer for the $ t $ -th test case.
Explanation/Hint
### Sample Explanation 1
For the first test case, $ |A_1-A_2| \times |A_1-A_3| \times |A_2-A_3|=8 \times 4 \times 4=128 $ , and the remainder when this is divided by $ 3 $ is $ 2 $ .
### Constraints
- $ 1 \leq T \leq 10^5 $
- $ 2 \leq N \leq 2 \times 10^5 $
- $ 1 \leq A_i \leq 10^9 $
- The sum of $ N $ over all test cases is at most $ 2 \times 10^5 $ .
- All input values are integers.