you give integer array num ith bag contain numsi ball you give integer maxoperationsyou perform follow operation maxoperations timestake bag ball divide new bag positive number ballsfor example bag 5 ball new bag 1 4 ball new bag 2 3 ballsYour penalty maximum number ball bag you want minimize penalty operationsreturn minimum possible penalty perform operation Example 1input num 9 maxoperations 2output 3explanation Divide bag 9 ball bag size 6 3 9 63 Divide bag 6 ball bag size 3 3 63 333the bag number ball 3 ball penalty 3 return 3example 2input num 2482 maxoperation 4output 2explanation Divide bag 8 ball bag size 4 4 2482 24442 Divide bag 4 ball bag size 2 2 24442 222442 Divide bag 4 ball bag size 2 2 222442 2222242 Divide bag 4 ball bag size 2 2 2222242 22222222the bag number ball 2 ball penalty 2 return 2 Constraints1 numslength 1051 maxoperation numsi 109