2717: Bloxorz I
Description
Desc
The box stands on a single cell
The box lies on two neighbouring cells, horizontally
The box lies on two neighbouring cells, vertically
After Little Tom passes several stages of the game, he finds it much harder than he expected. So he turns to your help.
Input
Input
It guarantees that
- There's only one 'O' in a plane.
- There's either one 'X' or neighbouring two 'X's in a plane.
- The first(and last) row(and column) must be '#'(empty cell).
- Cells covered by 'O' and 'X' are all rigid cells.
Output
Output
Sample Input Copy
7 7
#######
#..X###
#..##O#
#....E#
#....E#
#.....#
#######
0 0
Sample Output Copy
10