B - On a Diet 

Background

Alarm bells are ringing: Summer is rapidly approaching and our worst enemy is our mirror.

The Problem

We've got a kitchen recipe book including the calories associated to each course. We want to select some courses, without repeating, that match the amount of calories given or exceed them minimaly.

The Input

The first line of the input contains an integer, t, indicating the number of test cases. For each test case, three lines appear, the first one contains a number n, 100 ≤ n ≤ 2500, representing the minimun amount of calories we want to eat (n is multiple of 10). The second line contains a number p, 5 ≤ p ≤ 100, representing the number of courses we have. The third line of each test case contains p numbers, representing the amount of calories of the p courses (these p numbers are larger or equal to 50, smaller or equal to 2500, and multiple of 10).

The Output

For each test case the output should contain a single line, that consists of the amount of calories of our selection (i.e., the selection that matches the amount of calories given or exceeds them minimaly) or the string NO SOLUTION if no solution is possible.

Sample Input

4
2480
5
1230 1050 820 890 1150
2140
4
450 150 120 50
1200
5
320 570 610 1560 890
1810
6
2340 780 940 310 660 790

Sample Output

2760
NO SOLUTION
1210
1880

OMP'13
Facultad de Informatica
Universidad de Murcia (SPAIN)