Question 133
The following grid represents a mountain range; the number in each cell represents the height of the mountain located there. Moving from a mountain of height $a$ to a mountain of height $b$ takes $(b-a)^2$ time. Suppose that you start on the mountain of height $1$ and that you can move up, down, left, or right to get from one mountain to the next. What is the minimum amount of time you need to get to the mountain of height $49$?
| 1 | 3 | 6 | 10 | 15 | 21 | 28 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| 2 | 5 | 9 | 14 | 20 | 27 | 34 |
| 4 | 8 | 13 | 19 | 26 | 33 | 39 |
| 7 | 12 | 18 | 25 | 32 | 38 | 43 |
| 11 | 17 | 24 | 31 | 37 | 42 | 46 |
| 16 | 23 | 30 | 36 | 41 | 45 | 48 |
| 22 | 29 | 35 | 40 | 44 | 47 | 49 |
| 1 | 3 | 6 | 10 | 15 | 21 | 28 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| 2 | 5 | 9 | 14 | 20 | 27 | 34 |
| 4 | 8 | 13 | 19 | 26 | 33 | 39 |
| 7 | 12 | 18 | 25 | 32 | 38 | 43 |
| 11 | 17 | 24 | 31 | 37 | 42 | 46 |
| 16 | 23 | 30 | 36 | 41 | 45 | 48 |
| 22 | 29 | 35 | 40 | 44 | 47 | 49 |