Lunar New Year approach Bob planning famous restaurant AlicesThe restaurant alice serve n kind food the cost ith kind c_i initially restaurant ingredient serve exactly a_i dish ith kind in New Years Eve m customer visit Alices jth customer order d_j dish t_jth kind food the 1st customer come ith customer completely servedsuppose r_i dish ith kind remain initially r_i a_i when customer order 1 dish ith kind follow principle process if r_i 0 customer serve exactly 1 dish ith kind the cost dish c_i meanwhile r_i reduce 1 Otherwise customer serve 1 dish cheap available kind food if multiple cheap kind food small index cheap serve the cost cost dish serve remain correspond dish reduce 1 if dish customer leave angrily therefore matter dish serve previously cost customer 0if customer do not leave d_j dish serve cost customer sum cost d_j dishesplease determine total cost m customer