part arrays by sum