There are m real estate agents in the city. There is a street containing n houses in a straight line and they are numbered from 1 to n. The ith agent sells the houses with numbers from Ii to ri and gets ci dollars as the commission fee.
Note: The ith agent is paid either 0 or ci dollars.
If you want to buy a house, then you are required to pay the commission to all the agents selling that house but each agent can be paid at most once.
If you want to buy exactly k houses in the city, then determine the minimum amount of money that you must pay in dollars.
Input format
Output format
In a single line, print one number that represents the minimum amount of money that you are required to pay to buy exactly k houses.
Constraints
1≤n≤20001≤m≤1051≤k≤n1≤li≤ri≤n1≤ci≤109
We can buy houses with numbers [5,6,9,10]. In this situation we have to pay only 5$. (paying the second agent)