F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Jam's store

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 316    Accepted Submission(s): 142


Problem 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
 

Hint

the first guest choose the third staff
the second guest choose the second staff
the third gurst choose the third staff
the total of time is 4+2+1=7
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 21:40:46, Gzip enabled