there n shovel nearby shop the ith shovel cost a_i bourlesMisha buy exactly k shovel each shovel buy onceMisha buy shovel purchase during purchase choose subset remain nonbought shovel buy subsetthere m special offer shop the jth give pair x_j y_j mean Misha buy exactly x_j shovels purchase y_j cheap free ie pay y_j cheap shovel current purchaseMisha use offer possibly zero number time use offer purchase buy shovel offersyour task calculate minimum cost buy k shovel Misha buy optimally