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

People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known the price would not more than m.But he didn't know the exact price of the watch. You are to write a program which reads n,m,A1,A2,A3...An and C1,C2,C3...Cn corresponding to the number of Tony's coins of value A1,A2,A3...An then calculate how many prices(form 1 to m) Tony can pay use these coins. 输入描述 The input contains several test cases. The first line of each test case contains two intege输出描述 For each test case output the answer on a single line.输入例子 3 10 1 2 4 2 1 1 2 5 1 4 2 1 0 0 输出例子 8 4

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