P3045 [USACO12FEB] Cow Coupons G
Background
Subtask 0 为原数据,Subtask 1,2 为 hack 数据。
Description
Farmer John needs new cows! There are N cows for sale (1
Input Format
\* Line 1: Three space-separated integers: N, K, and M.
\* Lines 2..N+1: Line i+1 contains two integers: P\_i and C\_i.
Output Format
\* Line 1: A single integer, the maximum number of cows FJ can afford.
Explanation/Hint
FJ has 4 cows, 1 coupon, and a budget of 7.
FJ uses the coupon on cow 3 and buys cows 1, 2, and 3, for a total cost of 3 + 2 + 1 = 6.