시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB18414212876.647%

문제

You receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of all available items. From this list you would like to buy two items that add up to the entire value of the credit. The solution you provide will consist of the two integers indicating the positions of the items in your list (smaller number first).

입력

The first line of input gives the number of cases, NN test cases follow. For each test case there will be:

  • One line containing the value C, the amount of credit you have at the store.
  • One line containing the value I, the number of items in the store.
  • One line containing a space separated list of I integers. Each integer P indicates the price of an item in the store.
  • Each test case will have exactly one solution.

Limits

  • 5 ≤ C ≤ 1000
  • 1 ≤ P ≤ 1000
  • N = 50
  • 3 ≤ I ≤ 2000

출력

For each test case, output one line containing "Case #x: " followed by the indices of the two items whose price adds up to the store credit. The lower index should be output first.

예제 입력 1

3
100
3
5 75 25
200
7
150 24 79 50 88 345 3
8
8
2 1 9 4 4 56 90 3

예제 출력 1

Case #1: 2 3
Case #2: 1 4
Case #3: 4 5

채점 및 기타 정보

  • 예제는 채점하지 않는다.