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

Maximal submatrix

Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 4809    Accepted Submission(s): 1424


Problem Description
Given a matrix of n rows and m columns,find the largest area submatrix which is non decreasing on each column
 

Input
The first line contains an integer $T(1 \leq T \leq 10)$representing the number of test cases.
For each test case, the first line contains two integers $n,m(1 \leq n,m \leq2*10^3) $representing the size of the matrix
the next n line followed. the i-th line contains $m$ integers $v_{ij}$$(1 \leq v_{ij} \leq 5*10^3)$representing the value of matrix
It is guaranteed that there are no more than 2 testcases with $n*m>10000$
 

Output
For each test case, print a integer representing the Maximal submatrix
 

Sample Input
1 2 3 1 2 4 2 3 3
 

Sample Output
4
 

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-04-19 08:58:13, Gzip enabled