{"raw_statement":[{"iden":"problem statement","content":"Sigma and his brother Sugim are in the $H \\\\times W$ grid. They wants to buy some souvenirs.  \nTheir start position is upper-left cell, and the goal position is lower-right cell.  \nSome cells has a souvenir shop. At $i$-th row and $j$-th column, there is $a_{i, j}$ souvenirs.  \nIn one move, they can go left, right, down, and up cell.  \nBut they have little time, so they can move only $H+W-2$ times.  \nThey wanted to buy souvenirs as many as possible, but they had no computer, so they couldn't get the maximal numbers of souvenirs.  \nWrite a program and calculate the maximum souvenirs they can get, and help them."},{"iden":"input","content":"The input is given from standard input in the following format.  \n\n> $H \\\\ W$ $a_{1, 1} \\\\ a_{1, 2} \\\\ \\\\cdots \\\\ a_{1, W}$ $a_{2, 1} \\\\ a_{2, 2} \\\\ \\\\cdots \\\\ a_{2, W}$ $\\\\vdots \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\vdots \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\ \\\\vdots$ $a_{H, 1} \\\\ a_{H, 2} \\\\ \\\\cdots \\\\ a_{H, W}$"},{"iden":"sample input 1","content":"3 3\n1 0 5\n2 2 3\n4 2 4"},{"iden":"sample output 1","content":"21\n\nThe cell at $i$-th row and $j$-th column is denoted $(i, j)$.  \nIn this case, one of the optimal solution is this:  \n\n*   Sigma moves $(1, 1) -> (1, 2) -> (1, 3) -> (2, 3) -> (3, 3)$.\n*   Sugim moves $(1, 1) -> (2, 1) -> (3, 1) -> (3, 2) -> (3, 3)$.\n\nThen, they can get $21$ souvernirs."},{"iden":"sample input 2","content":"6 6\n1 2 3 4 5 6\n8 6 9 1 2 0\n3 1 4 1 5 9\n2 6 5 3 5 8\n1 4 1 4 2 1\n2 7 1 8 2 8"},{"iden":"sample output 2","content":"97"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}