Jam's store

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5619
64-bit integer IO format: %I64d      Java class name: Main

Description

Jam didn't study well,then he go to repair the computer in a store,there are $M$ staffs and $N$ guests, given each guests have to spend $T_{ij}$ time to repair the computer by the $j$ staffs.

Now ask the total of time the guest at least to wait.
The staff wiil do the next work after he has done the current work

Input

The first line is $T(1 \leq T \leq 100)$ means $T$ Case

For each case

The first line is $M$ and $N(1 \leq M,N \leq 20)$ means the number of staffs and guests

Now given a Matrix with $N*M$ each number means the $i$ guests to the $j$ staff time $(1 \leq T_{ij} \leq 1000)$

Output

Output one line about the time at least they need to wait

Sample Input

1
4 3
4 4 1 5
8 2 5 6
4 5 10 5

Sample Output

7

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .