there n pile coin table each pile consist positive number coin assort denominationsIn choose coin pile remove add walletgiven list pile pilesi list integer denote composition ith pile positive integer k return maximum total value coin wallet choose exactly k coin optimally Example 1input pile 11003789 k 2output 101explanationthe diagram show different way choose k coinsthe maximum total obtain 101example 2input pile 100100100100100100111111700 k 7Output 706explanationthe maximum total obtain choose coin pile Constraintsn pileslength1 n 10001 pilesij 1051 k sumpilesilength 2000