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

Matrix

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1    Accepted Submission(s): 1


Problem Description
You are given a matrix which is n rows m columns (1 <= n <= m <= 100). You are supposed to choose n elements, there is no more than 1 element in the same row and no more than 1 element in the same column. What is the minimum value of the K_th largest in the n elements you have chosen.
 

Input
First line is an integer T (T ≤ 15), the number of test cases. At the beginning of each case is three integers n, m, K, 1 <= K <= n <= m <= 100.
Then n lines are given. Each line contains m integers, indicating the matrix.
All the elements of the matrix is in the range [1, 109].
 

Output
For each case, output Case #k: one line first, where k means the case number count from 1. Then output the answer.
 

Sample Input
2 2 3 1 1 2 4 2 4 1 3 4 2 1 5 6 6 8 3 4 3 6 8 6 3
 

Sample Output
Case #1: 1 Case #2: 3
 

Source
 

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