You are given a list of integers amounts and an even integer k. You have amounts[i] units of item type i, and there are k containers, all initially empty.
You may split the units of each type into any number of parts. Each part is a non-negative number of units of a single type and goes into its own container, so a container never holds two different types. You may leave any of a type's units unused, and you may leave any container empty.
After every part is placed, the k / 2 containers holding the most units are lost. The safe total is the number of units in the other k / 2 containers. If several containers hold the same number of units, the tie can be broken in any way. The safe total does not depend on it.
Return the maximum safe total you can achieve.
amounts.length ≤1000k ≤1000k is evenamounts[i] ≤109