经典指数          
POJ
原因
959
浏览数
0
收藏数
 

As a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of coins i输入描述 * Line 1: Two space-separated integers: N and C * Lines 2..N+1: Each line corresponds to a denomination of coin and contains two integers: the valu输出描述 * Line 1: A single integer that is the number of weeks Farmer John can pay Bessie at least C allowance输入例子 3 6 10 1 1 100 5 120 输出例子 111 Hint INPUT DETAILS: FJ would like to pay Bessie 6 cents per week. He has 100 1-cent coins,120 5-cent coins, and 1 10-cent coin. OUTPUT DETAILS: FJ can overpay Bessie with the one 10-cent coin for 1 week, then pay Bessie two 5-cent coins for 10 weeks and then pay Bessie one 1-cent coin and one 5-cent coin for 100 weeks.

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题