It's time to settle things once and for all. Your boomerang crew has decided to challenge their rivals to a boomerang crew battle!
Your crew has N members with strengths A1..N, while the opposing crew has M members with strengths B1..M. The crew battle will proceed as follows:
However, you're not about to play fair with your enemies — you've got the following 3 things going for you:
Despite these advantages, it's possible that you'll still be unable to emerge victorious. However, whether or not you do, you'd like to maximize the number of throwing contests that members of your crew win over the course of the crew battle (given that you choose optimal initial orderings for both lines).
Input begins with an integer T, the number of battles. For each battle, there are three lines. The first line contains the space-separated integers N, M, and D. The second line contains the N space-separated integers A1 to AN. The third line contains the M space-separated integers B1 to BM.
For the ith battle, print a line containing "Case #i: " followed by the maximum number of throwing contests that your crew can win.
1 ≤ T ≤ 75
1 ≤ N, M ≤ 100,000
1 ≤ Ai, Bi, D ≤ 1,000,000,000
In the first battle, your single member cannot beat theirs. In the second battle, they can (just barely). In the fourth battle, one solution is to arrange their crew as [35, 25, 5] and your crew as [10, 20, 30] to emerge victorious (in which case, 5 throwing contests will occur, of which your crew will win the last three).