Question
K Cheapest Items
You are given
Use a heap to maintain the selected items.
Input
The first line contains KaTeX can only parse string typed expression and KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression prices.
Output
Print the minimum possible total cost.
Example
Example:
Input
Input
5 3
8 2 7 4 5Output11