EXPOR - OR
Given an array of N integers A1, A2, A3…AN. If you randomly choose two indexes i, j such that 1 ≤ i < j ≤ N, what is the expected value of Ai | Aj?
Input
First line contains an integer T, the number of test cases. Each test case consists of two lines. First line denotes the size of array, N and second line contains N integers forming the array.
1 ≤ T ≤ 10
2 ≤ N ≤ 100,000
0 ≤ Ai < 231
Output
For each test case, print the answer as an irreducible fraction. Follow the format of the sample output.
The fraction p/q (p and q are integers, and both p ≥ 0 and q > 0 holds) is called irreducible, if there is no such integer d > 1 that divides both p and q separately.
Example
Input: 2 2 0 0 3 1 2 3 Output: 0/1 3/1
Added by: | Evan |
Date: | 2016-08-26 |
Time limit: | 0.5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | https://algo.codemarshal.org/contests/goc-0101 |