AT_abc407_g [ABC407G] Domino Covering SUM

Description

There is a grid with $ H $ rows and $ W $ columns. Let $ (i,j) $ denote the cell at the $ i $ -th row from the top $ (1\leq i\leq H) $ and the $ j $ -th column from the left $ (1\leq j\leq W) $ . Cell $ (i,j)\ (1\leq i\leq H,1\leq j\leq W) $ has an integer $ A_{i,j} $ written on it. Let us place zero or more dominoes on the grid. A domino covers two adjacent cells, namely one of the following pairs: - cells $ (i,j) $ and $ (i,j+1) $ for $ 1\leq i\leq H,1\leq j\lt W $ ; - cells $ (i,j) $ and $ (i+1,j) $ for $ 1\leq i\lt H,1\leq j\leq W $ . No cell may be covered by more than one domino. For a placement of dominoes, define its **score** as the sum of all integers written in cells **not** covered by any domino. Find the maximum possible score.

Input Format

The input is given from Standard Input in the following format: > $ H $ $ W $ $ A _ {1,1} $ $ A _ {1,2} $ $ \ldots $ $ A _ {1,W} $ $ A _ {2,1} $ $ A _ {2,2} $ $ \ldots $ $ A _ {2,W} $ $ \vdots $ $ A _ {H,1} $ $ A _ {H,2} $ $ \ldots $ $ A _ {H,W} $

Output Format

Output the answer.

Explanation/Hint

### Sample Explanation 1 The grid is as follows: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc407_g/0420a91d171c5fd7c633be9c3f57e8e7230aea5d1e374921b4604cbf1214955e.png) For example, the placement below yields a score of $ 23 $ . ![](https://cdn.luogu.com.cn/upload/vjudge_pic/AT_abc407_g/b0fdd5aa60a827869d09daa7e2dda1b83050c7858910ca3af50071b64d96fcda.png) No placement achieves a score of $ 24 $ or higher, so output `23`. ### Constraints - $ 1\leq H $ - $ 1\leq W $ - $ HW\leq2000 $ - $ -10 ^ {12}\leq A _ {i,j}\leq10 ^ {12}\ (1\leq i\leq H,1\leq j\leq W) $ - All input values are integers.