11384 - Help is needed for Dexter


Difficulty : easy

Solution Description :

Simple math problem

Optimal solution always only subtracts powers of 2 from the set of selected numbers

Example
input 10
1 2 3 4 5 6 7 8 9 10
subtract 2^3=8 from greater or equal 8
1 2 3 4 5 6 7 0 1 2
subtract 2^2=4 from greater or equal 4
1 2 3 0 1 2 3 0 1 2
subtract 2^1=2 from greater or equal 2
1 0 1 0 1 0 1 0 1 0
subtract 2^0=1 from greater or equal 1
0 0 0 0 0 0 0 0 0 0