Less Money, More Problems (Large)

Add the fewest new coin denominations so every value up to V is payable with at most C coins of each denomination.

Medium6GreedyMathNo attempts yetTime limit5sMemory limit512 MB

Problem

Until today, the country you live in has used DD different positive integer coin denominations for every transaction. Today a subject tried to pay his taxes with a giant sack of low value coins, the queen lost her temper, and she decreed that no single purchase may use more than CC coins of any one denomination. For example, if C=2C = 2 and the existing denominations are 1 and 5, you can buy an item worth 11 with two 5s and one 1, and you can buy an item worth 12 with two 5s and two 1s, but you cannot buy an item worth 9 or an item worth 17.

You cannot defy the decree directly. You do run the mint, so you can issue coins of new denominations. You want every item whose value is a positive integer at most VV to be purchasable under the new rule. (This may not have been possible even before the decree.) You want to introduce as few new denominations as possible, and the final set of old and new denominations may not contain the same value twice.

Print the smallest number of new denominations you need.

Input

The first line contains the number of test cases TT. Then TT test cases follow. Each test case consists of one line with three space separated integers CC, DD, and VV, followed by one line with the DD existing denominations in ascending order, separated by spaces. The existing denominations are pairwise distinct.

Limits

  • 1T1001 \le T \le 100
  • 1C1001 \le C \le 100
  • 1D1001 \le D \le 100
  • 1V1091 \le V \le 10^9
  • every existing denomination is a positive integer at most VV

Output

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 minimum number of new denominations.

Hint

In the first test case of the example, the existing denominations 1 and 2 already cover the required values 1, 2, and 3 with one copy of each.

In the second test case, adding either denomination 3 or denomination 4 is enough, so one new denomination suffices whichever you pick.

In the third test case, adding denomination 1 is optimal.