P2918 [USACO08NOV] Buying Hay S
Description
Farmer John is running out of supplies and needs to purchase $H(1 \le H \le 50,000)$ pounds of hay for his cows.
He knows $N(1 \le N \le 100)$ hay suppliers conveniently numbered $1..N$. Supplier i sells packages that contain $P_i(1 \le P_i \le 5,000)$ pounds of hay at a cost of $C_i(1 \le C_i \le 5,000)$ dollars. Each supplier has an unlimited number of packages available, and the packages must be bought whole.
Help FJ by finding the minimum cost necessary to purchase at least $H$ pounds of hay.
Input Format
\* Line $1$: Two space-separated integers: $N$ and $H$
\* Lines $2..N+1$: Line $i+1$ contains two space-separated integers: $P_i$ and $C_i$
Output Format
\* Line $1$: A single integer representing the minimum cost FJ needs to pay to obtain at least $H$ pounds of hay.
Explanation/Hint
FJ can buy three packages from the second supplier for a total cost of $9$.