3010. Coins (III)

单点时限: 1.0 sec

内存限制: 256 MB

In a strange shop there are types of coins of value . denote the number of coins of value respectively. You have to find the number of different values (from to ), which can be produced using these coins.

输入格式

Input starts with an integer (), denoting the number of test cases.

Each case starts with a line containing two integers () and (). The next line contains integers, denoting (). All will be distinct.

输出格式

For each case, print the case number and the result.

样例

Input
2
3 10
1 2 4 2 1 1
2 5
1 4 2 1
Output
Case 1: 8
Case 2: 4

31 人解决,35 人已尝试。

49 份提交通过,共有 124 份提交。

3.9 EMB 奖励。

创建: 6 年,4 月前.

修改: 2 年,3 月前.

最后提交: 1 周,1 天前.

来源: Coins 系列

题目标签
DP