Ecological Bin Packing C++