SP10883 CUSTOMSL - Customs

Description

Matheus, Bruno and Ricardo are the boasting for the research department at Indústria de Obras Intermináveis ( IOI ) and they constantly traveled together for another countries to research different methods, equipments and primal materials for amazing works. Furthermore, they operate in the informal import market products electronics, bringing equipments and electronics for your friend and coworkers. Before leaving they make a list of N products who they have to buy, each one of them with a price Pi DE$ ( Dinheiro Estrangeiro). They have to pay some customs duty if anyone of them exceeds the maximum amount of Q that each one can brings. As them always travel together, they note that it’s more cheap for them, if the products are organizated in a way that’s can be possible to reduct the maximum amount of imposts who they have to pay. Given the prices of N products, Q and the maximum tax A, you have to say the minimum price of imposts that they have to pay.

Input Format

The input is only a testcase. The first line include an integer N ( 1

Output Format

You have to write in your output a single line contains the minimum possible value of impost that Matheus, Bruno and Ricardo have to pay..