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

Chocolate Machine

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)
Total Submission(s): 566    Accepted Submission(s): 177


Problem Description
There is a Vending machine sales which sell magic chocolate in Renren office. The chocolate is shaped like a n*m rectangle, and
each 1*1 unit is assigned with a delicious degree. A consumer can chose a Staircase-shaped chocolate (whose bottom and right edge must be a straight line) to buy, if there isn't
any units' delicious degree is less than K. And the price of this block is equal to the sum of delicious degree it contains.
Chould you help the manager to figer out how much can he earn at most?

This is a sample of a Staircase-shaped chocolate. Noting that a rectangle is also a Special case of Staircase-shaped
chocolate.
 

Input
The first line contains a positive integer: the number of test cases, at most 100.
After that per test case:
One line with three integers n, m and K (1 ¡Ü n, m ¡Ü 3 000, K ¡Ü 1000000): the dimensions of chocolate.
Next n lines, each with m positive integers(less than 1000000). The jth colume of the ith line represents the delicious
degree of i*j unit.
 

Sample Input
1 2 3 2 2 3 4 2 2 1
 

Sample Output
9
 

Hint

We can sold:
2 3
2 2
or
2 3 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-05-02 12:29:45, Gzip enabled