#graph703. 方格取数
方格取数
Number Picking on a Grid
Problem Source
Network Flow 24 Problems
Problem Description
On an grid board, each cell contains a positive integer.
Now you want to pick numbers from the cells so that no two picked cells share an edge (i.e. they are not adjacent), while maximizing the total sum of the numbers picked. Find that maximum sum.
Input Format
The first line contains two positive integers , the number of rows and columns of the board. The next lines each contain positive integers, the numbers in the cells; each number does not exceed .
Output Format
Output the maximum total sum of the picked numbers.
Sample Input
3 3
1 2 3
3 2 3
2 3 1
Sample Output
11