2966 divide array into arrays with max difference