finish max_sum.cpp,but not the best answer,need to think more