Find the maximum profit when the first i items are sold in market A and the rest of the items are sold in market B for all possible values of i
for ( int i = 1 ; i < n - 1 ; i ++ ) { res = max ( res , preSum [ i ] + suffSum [ i + 1 ] ) ; }