you give sorted array a_1 a_2 dots a_n index 1 condition a_i ge a_i1 hold integer kYou ask divide array k nonempty consecutive subarray every element array include exactly subarray let maxi equal maximum ith subarray mini equal minimum ith subarray the cost division equal sumlimits_i1k maxi mini for example 2 4 5 5 8 11 19 divide 3 subarray follow way 2 4 5 5 8 11 19 cost division equal 4 2 5 5 19 8 13calculate minimum cost obtain divide array k nonempty consecutive subarray