Store Credit (Large)

No attempts yetTime limit5sMemory limit512 MB

Problem

A local store gives you a credit of CC, and you want to spend all of it on exactly two items.

You first walk through the store and write down the price of every item on sale, in order, forming a list LL. From this list you pick two items whose prices add up to exactly the credit.

The answer is the pair of positions those two items occupy in the list. The first item in the list is at position 1, and the smaller position is written first.

Input

The first line contains the number of test cases NN. NN test cases follow, each made of three lines.

  • The first line contains CC, the credit you have at the store.
  • The second line contains II, the number of items in the store.
  • The third line contains II prices PP separated by spaces, in the order you wrote them down.

Each test case has exactly one solution: only one pair of positions has prices adding up to CC.

Limits

  • 1N501 \le N \le 50
  • 5C10005 \le C \le 1000
  • 3I20003 \le I \le 2000
  • 1P10001 \le P \le 1000

Output

For each test case, print one line containing Case #x: followed by the positions of the two items whose prices add up to the credit, separated by a space. Here xx is the test case number starting from 1, and the lower position comes first.