#C383. Closest Equal Bean Distribution
Closest Equal Bean Distribution
Closest Equal Bean Distribution
You are given a number of test cases. For each test case, you are given an integer N representing the number of bags and a list of N integers representing the number of beans in each bag. Your task is to determine the closest possible equal distribution of beans by computing:
$$\left\lfloor \frac{\text{total beans}}{N} \right\rfloor$$
For each test case, print the result in a separate line.
inputFormat
The input is given via standard input. The first line contains an integer T
representing the number of test cases. For each test case:
- The first line contains an integer
N
— the number of bags. - The second line contains
N
space-separated integers representing the number of beans in each bag.
outputFormat
For each test case, output a single integer—the closest equal distribution (i.e. the integer part of the average number of beans) on a new line.
## sample1
3
4 4 4
4
</p>