solves BinPacking problem