you give integer array cookies cookiesi denote number cookie ith bag you give integer k denote number child distribute bag cookie all cookies bag child split upthe unfairness distribution define maximum total cookie obtain single child distributionreturn minimum unfairness distribution Example 1input cookie 81510208 k 2output 31Explanation one optimal distribution 8158 1020 the 1st child receive 8158 total 8 15 8 31 cookie the 2nd child receive 1020 total 10 20 30 cookiesthe unfairness distribution max3130 31it show distribution unfairness 31example 2input cookie 61322412 k 3output 7Explanation one optimal distribution 61 322 412 the 1st child receive 61 total 6 1 7 cookie the 2nd child receive 322 total 3 2 2 7 cookie the 3rd child receive 412 total 4 1 2 7 cookiesthe unfairness distribution max777 7it show distribution unfairness 7 constraints2 cookieslength 81 cookiesi 1052 k cookieslength