Given pages of n books (in order) and m students, allocate contiguous books so each student gets at least one book and the maximum pages assigned to any student is minimized. Return that minimum; return -1 if m>n. Input: '[books], m'.
Input: '[books], m'.
Output: Integer — minimized max pages, or -1.
Input: [12,34,67,90], 2
Output: 113
Explanation: [12,34,67] and [90].Input: [10,20,30,40], 2
Output: 60
Explanation: [10,20,30] and [40].Input: [1,2,3,4], 1
Output: 10
Explanation: All to one student.1<=n<=10^41<=m<=10^41<=books[i]<=10^6