Link:
https://www.nowcoder.com/acm/contest/107/D
Source: Niuke.com
Source: Niuke.com
Topic description
Now there are
n
numbers, take two numbers
x, y randomly each time
, and then add a number as
(x+y)/2
, what is the expectation of the last remaining number?
Enter description:
There are multiple sets of input data, the first row is a number T, which means there are T sets of input data (0<T≤20). Next is the T group data. Each set of test data is divided into 2 lines: The first line is n, indicating that there are n numbers (1≤n≤100) The next line has n positive integers ai, representing the initial n numbers (1≤ai≤10000, 1≤i≤n).
Output description:
For each set of data, output the integer part of the expected value of the last remaining number on one line.