#P2695. 骑士的工作
骑士的工作
Description
Each person can cut off at most one head of size not exceeding , and it costs coins. Find the minimum total cost.
Input Format
- The first line contains two integers , .
- The next lines each contain one integer, the size of a head.
- The next lines each contain one integer , the maximum head size the -th person can cut and the number of coins required.
Output Format
Output a single integer, the minimum total cost. If it is impossible, output you died!.
2 3
5
4
7
8
4
11
Hint
For all testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号