Company: HackerRank
Difficulty: medium
Maximum Grid Path Score You are given an integer grid. One path starts at `(0, p)` and moves down one row at a time; another starts at `(rows-1, q)` and moves up one row at a time. At each move, the column may decrease by one, stay the same, or increase by one, while remaining in the grid. Find the larger maximum path sum. Input Format The first line contains `rows` and `cols`. The next `rows` lines contain the grid. The final line contains `p` and `q`. Output Format Print the maximum score. Constraints `1 <= rows, cols <= 1000`; grid values fit in signed 32-bit integers; `0 <= p,q < cols`. Example For `[[1,2,3],[4,5,6],[7,8,9]]`, `p=1`, `q=0`, the answer is `17`.