Lelei is surveying a large field made up of
A large battle involving dragons has taken place here, and as such there are scales from dragons strewn all about the field. As dragon scales are extremely valuable and fetch a high price, Lelei would like to collect as many as possible. However, a battlefield is a pretty dangerous place to be, so she can only risk spending enough time on it to pick up the scales in a rectangular subsection of the field with a total area up to
Given the distribution of scales on the field and the maximum
Constraints
Subtask 1 [10%]
Subtask 2 [15%]
Subtask 3 [25%]
Subtask 4 [50%]
Input Specification
The first line of input will contain 3 space-separated integers
The next
Output Specification
A single integer, the maximum number of scales that Lelei can pick up.
Sample Input 1
5 5 4
0 0 0 0 10
0 5 0 1 2
2 0 3 7 1
8 9 0 1 3
1 5 2 3 7
Sample Output 1
23
Explanation for Sample Output 1
Lelei should explore the
Sample Input 2
1 2 1
0
5
Sample Output 2
5
Explanation for Sample Output 2
Lelei only has time for
Comments