luogu#P2695. 骑士的工作
骑士的工作
Background
As the village chief, it is your duty to defend the village. Today, a dragon has come with heads, wreaking havoc everywhere. You are anxious. Fortunately, a group of knights has arrived. There are members in the group.
Problem 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