Cleaning Stations

Given weights and a feature matrix, print the indices of the rows whose weighted sum is largest, in ascending order, for each of K data sets.

Easy2ImplementationArrayMathInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

One of the symbiotic relationships among marine animals is the cleaning station. A cleaning station is a place such as a sea mount where cleaner fish gather in large numbers. A large fish such as a shark swims up to a cleaning station and picks out cleaner fish to take the parasites off its skin. The cleaner fish get a meal and the shark gets cleaned. Both profit.

A shark is defenseless while it is being cleaned, so it is very picky about which fish it lets near. If anything seems off, it leaves at once. The caution is earned. Some cleaner fish take small bites out of the shark along with the parasites.

A shark judges a cleaner fish by several features, and it assigns every feature a weight that is either positive or negative. One shark may prefer a larger cleaner fish, want a shorter distance to swim, and want the cleaner fish to move slowly. Given the feature values of every cleaner fish, find all the cleaner fish whose weighted sum of feature values is the largest.

Input

The first line contains the number KK of data sets. KK data sets follow, each in the format below.

The first line of a data set contains two integers nn and mm. nn is the number of cleaner fish, with 1n1001 \le n \le 100, and mm is the number of features the shark judges by, with 1m101 \le m \le 10.

The next line contains mm integers x1,x2,,xmx_1, x_2, \dots, x_m, the weights the shark assigns to the mm features. Every weight is between 20-20 and 2020.

Then come nn lines, one per cleaner fish. The ii-th of those lines contains mm integers yi,1,yi,2,,yi,my_{i,1}, y_{i,2}, \dots, y_{i,m}, the feature values of cleaner fish ii. Every yi,jy_{i,j} is an integer between 20-20 and 2020.

Output

For each data set, first print Data Set x: on a line of its own, where xx is the number of the data set counting from 11.

Then print, in ascending order and one per line, the numbers of all cleaner fish whose weighted sum j=1mxjyi,j\sum_{j=1}^{m} x_j y_{i,j} is the largest. Cleaner fish are numbered 11 through nn in input order.

Print one blank line after the output of each data set.