Problem Statement | |||||||||||||
There are some bottles on the table. The i-th bottle contains waterVolumes[i] liters of water. You can pour out water from any bottle to any other. The volume of water you pour out is not necessarily an integer. It takes 1 second to pour 1 liter of water. Each bottle is large enough to contain as much water as you want. Return the minimal time in seconds required to make each bottle contain an equal volume of water. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The returned value must be accurate to within a relative or absolute value of 1E-9. | ||||||||||||
Constraints | |||||||||||||
- | waterVolumes will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of waterVolumes will be between 1 and 10, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|