Qualification Round (Large)

No attempts yetTime limit5sMemory limit512 MB

Problem

The qualification round of a programming contest just ended. You advanced, and you want to know how many of your fellow contestants advanced with you. The only information you have is how many people solved each problem.

The qualification round consisted of PP problems, and problem ii (for 0iP10 \le i \le P-1) was fully solved by SiS_i contestants. A contestant had to solve CC problems to advance to the next round. Solving the same problem twice counts once, so every contestant who advanced solved at least CC distinct problems.

Using only that information, find the maximum number of contestants who could have advanced.

Input

The first line of the input gives the number of test cases, TT. TT lines follow. Each consists only of space separated integers: first PP, then CC, then the PP integers S0S_0 through SP1S_{P-1}.

Limits

  • 1T1001 \le T \le 100
  • 1CP601 \le C \le P \le 60
  • 0Si10170 \le S_i \le 10^{17}

Output

For each test case, output one line containing Case #x: y, where xx is the test case number (starting from 1) and yy is the maximum number of contestants who could have advanced, that is, the maximum number of contestants who could have solved at least CC distinct problems.

yy can be as large as 6×10186 \times 10^{18}, so use a 64 bit integer type.