Company: Arcadis
Difficulty: medium
Samurai and His Friends Two friends start at `(0,0)` and `(0,n-1)` in a chocolate grid. On each row transition, each moves down-left, down, or down-right while staying in the grid. Collect the chocolates in visited cells; a shared cell is counted once. Print the maximum total collected after the final row. Input Format First line: `m n`. Then `m*n` non-negative grid values in row-major order. Output Format Print the maximum total. Constraints `1 <= m,n <= 70`; each grid value is between `0` and `10^9`. Example Input 2 3 8 19 0 25 6 17 Output 50 The friends start at (0,0) and (0,2) , collecting 8 + 0 = 8 . Moving down, the first can reach column 0 and the second column 2 , collecting 25 + 17 = 42 . The total is 50 .