35 人解决，36 人已尝试。
55 份提交通过，共有 85 份提交。
2.8 EMB 奖励。
单点时限: 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 ways you can make using the coins.
For example, suppose there are three coins and we can use coin at most times, coin at most times and coin at most time. Then if the possible ways are:
So, 5 can be made in 3 ways.
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 number of ways K can be made. Result can be large, so, print the result modulo .
2 3 5 1 2 5 3 2 1 4 20 1 2 3 4 8 4 2 1
Case 1: 3 Case 2: 9