|
||||||||||
3-idiotsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13331 Accepted Submission(s): 4333 Problem Description King OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of performance art, and begged the king to free them. Out of hatred to the real idiots, the king wanted to check if they were lying. The three men were sent to the king's forest, and each of them was asked to pick a branch one after another. If the three branches they bring back can form a triangle, their math ability would save them. Otherwise, they would be sent into jail. However, the three men were exactly idiots, and what they would do is only to pick the branches randomly. Certainly, they couldn't pick the same branch - but the one with the same length as another is available. Given the lengths of all branches in the forest, determine the probability that they would be saved. Input An integer T(T¡Ü100) will exist in the first line of input, indicating the number of test cases. Each test case begins with the number of branches N(3¡ÜN¡Ü105). The following line contains N integers a_i (1¡Üa_i¡Ü105), which denotes the length of each branch, respectively. Output Output the probability that their branches can form a triangle, in accuracy of 7 decimal places. Sample Input
Sample Output
Source | ||||||||||
|