Petya organize strange birthday party he invite n friend assign integer k_i ith now Petya like present in nearby shop m unique present available jth present cost c_j dollar 1 le c_1 le c_2 le ldots le c_m its allow buy single present onceFor ith friend Petya buy present j le k_i cost c_j dollar c_k_i dollar directlyhelp Petya determine minimum total cost host party