L-Board
문제
Lord Pooty has a by board of integers and would like to draw an L. However, he would like to maximise the sum of integers on the tiles covered by L. The L can be rotated in all 4 possible orientations such that the sides are parallel to the board. Each side of the L may not necessarily be drawn (a straight line is possible). Some examples of valid Ls are shown below:
[이미지 1]
Formally, you want to choose points, , and (which may not necessarily be distinct) on the board such that
is maximised.
입력
Your program must read from standard input.
The input starts with a line with two integers and where and are height and width of the board. This is followed by lines of integers, representing the board.
출력
Your program must print to standard output.
The output should contain a single integer on a single line, the maximum possible.
예제
예제 1
2 2 8 1 3 4
15
예제 2
1 8 -2 -1 8 -2 9 0 -2 1
15