* Line 1: The value of N.
* Lines 2..1+N: Line i+1 contains the integers g_i and d_i.
* Line 1: The maximum number of gallons of milk Farmer John can obtain.
4
10 3
7 5
8 1
2 1
INPUT DETAILS: There are 4 cows. The first produces 10 gallons of milk if milked by time 3, and so on.
25
OUTPUT DETAILS: Farmer John milks cow 3 first, giving up on cow 4 since she cannot be milked by her deadline due to the conflict with cow 3. Farmer John then milks cows 1 and 2.