Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Expected Difference
Description Given m, then choose m distinct elements B = { B_{1}, B_{2}, …, B } randomly from _{m}A. You are to calculate the expected difference between the largest and smallest number of B.For example, consider the case where Input The input contains multiple test cases. Each test case contains consists of two lines. The first line gives the integers A ≤ 65 536), which will be sorted in increasing order._{i}A pair of zeroes indicates the end of the input and should not be processed. Output Output the answer of each test case on a separate line with the fraction rounded to 3 decimal places. Sample Input 2 2 1 2 3 2 1 2 3 4 2 1 2 3 4 4 3 2 3 8 9 0 0 Sample Output 1.000 1.333 1.667 6.500 Source POJ Monthly--2006.09.29, ACRush |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator