solving minsum problem