There are n boxes of widths w1,w2,…,wn and one big box of width W. Write a program that counts the ways to put the boxes into the big box.
The conditions are as follows.
The first line contains the number of test cases T (T≤100).
The first line of each test case contains n (1≤n≤100) and W (1≤W≤1000). The second line contains the box widths w1,w2,…,wn. (1≤wi≤W)
For each test case, print one line in the form Case x: y, where x is the test case number starting from 1 and y is the number of ways modulo 10007.
For n=3, W=5 and widths 1,2,3, these six ways are possible. Each line lists the widths of the boxes in the order they went in, starting from the left.
Putting in a single box, so 1, 2, or 3 on its own, breaks condition 2. A box that fits into the empty space on the right is still left out.