Company: Algo university on campus_13april
Difficulty: medium
Vanellope and Ralph are teaming up to collect candies in a 'Sugar Rush' level, represented by an $n \times m$ grid. Each cell $(i, j)$ contains $a_{i,j}$ candies. They want to maximize their combined score. Rules of the Challenge: Grid: An $n \times m$ grid with $a_{i,j}$ candies in each cell. Starting Points: Vanellope starts at the top-left cell $(0, 0)$. Ralph starts at the top-right cell $(0, m - 1)$. Movement: Both move simultaneously, one row down at each step. From cell $(r, c)$, a player can move to $(r + 1, c - 1)$, $(r + 1, c)$, or $(r + 1, c + 1)$. Players must always stay within the grid boundaries. Goal & Scoring: Both must reach the bottom row (i.e., $n - 1$). Candies in a cell are collected when visited. If both players visit the same cell, the candies are collected only once. What is the maximum total number of candies they can collect together? Input Format: The first line contains two integers $n$ and $m$ ($2 \le n, m \le 100$). Then $n$ lines follow, each with $m