The game of hopscotch involves chalk, sidewalks, jumping, and picking things up. In our variant, money is involved as well.
The game is played on a square grid of dimension $n$: each grid location is labelled $(p, q)$ where $0 \le p < n$ and $0 \le q < n$. On each grid location there is a stack of between $0$ and $100$ pennies.
A contestant begins by standing at location $(0, 0)$. The contestant collects the pennies on the square where they stand, then jumps either horizontally or vertically to another square. The destination square must be within the contestant's jumping capability of $k$ locations (that is, it lies in the same row or the same column and is at most $k$ steps away), and it must hold strictly more pennies than the square the contestant is currently on.
The contestant keeps jumping and collecting until no legal move remains. Given $n$, $k$, and the number of pennies on each grid location, compute the maximum number of pennies the contestant can collect.