you give 0indexed integer array pile pilesi represent number stone ith pile integer k you apply follow operation exactly k timeschoose pilesi remove floorpilesi 2 stone itNotice apply operation pile oncereturn minimum possible total number stone remain apply k operationsfloorx greatest integer small equal x ie rounds x example 1input pile 549 k 2output 12Explanation step possible scenario apply operation pile 2 the result pile 545 apply operation pile 0 the result pile 345the total number stone 345 12example 2input pile 4367 k 3output 12Explanation step possible scenario apply operation pile 2 the result pile 4337 apply operation pile 3 the result pile 4334 apply operation pile 0 the result pile 2334the total number stone 2334 12 Constraints1 pileslength 1051 pilesi 1041 k 105