| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 0 | 0 | 0 | 0.000% |
The cows have boarded their station wagon to head to town for their annual shopping trip at garage sales. They have peculiar tastes and shop only for artistic objects that are pretty much the same size.
While peculiar, their tastes are impeccable and they have the uncanny ability to know exactly how much a given object will fetch on the open market. Sometimes, they can sell the objects for a profit.
Given the labeled price and the actual value for a set of objects, calculate the greatest possible profit the cows can make, given that only K of the objects will fit in the station wagon. Of course, the cows can buy only one of each type of object.
A single line containing one integer, the largest possible profit given the constraints.
2 5 4 3 5 6 6 9 7 12 8 7
8