A `n` * `m` grid as follow:

The height of the grid point at the i^{th} row and j^{th} column is `h _{i j}`.

The whole grid is under a uniform gravity field.(Gravitational acceleration g = 10m/s

In the beginning, there is a little ball at point(0, 0) with 0 kinetic energy. It can move along the grid lines to adjacent grid points.

The motion of the ball obeys the law of the conservation of energy. But the direction of motion allows sudden change.

When the ball moves along a direction and arrives in point(p, q), it randomly choose a direction with equal probability among all feasible directions(It depends on whether the energy is enough).

Please calculate the expectation time it takes to move from point(0, 0) to point(n - 1, m - 1).

Output "Never reach!" if the ball can never move to point(n - 1, m - 1).

The input consists of several cases.
The first line of each case consists of two positive integers `n` and `m` (1 ≤ `n`, `m` ≤ 8), indicating the size of the grid.
The following `n` lines each with `m` non-negative integers(≤ 100000) describe the height of each grid point.
Adjacent heights are different.

提交代码