#572. 「Nowcoder多校 2019 Day2」Inside A Rectangle
「Nowcoder多校 2019 Day2」Inside A Rectangle
当前没有测试数据。
题目描述
Given grid, each cell has a value , you can choose at most two rectangles such that sum of values of the cell belonging to one rectangle is maximized.
A rectangle can be defined as four integers where and . Then, the rectangle is composed of all the cell (x, y) where and .
After choosing the rectangles, the resulting value will be the sum of values of the cell belonging to one of them.
输入格式
The first line of input contains two space-separated integers N and M. Following N lines each contains M space-separated integers .
输出格式
Output one line containing an integer representing the answer.
样例
样例输入 1
5 5
10 10 10 10 -1
10 -1 -1 -1 10
10 -1 -1 -1 10
10 -1 -1 -1 10
-1 10 10 10 10
样例输出 1
140
数据范围与提示