Marr E.O. is currently working on his next video game. He is creating a side-scrolling game and wants you to ensure that the levels that he is creating are possible to complete.
The character in the game, Loo E.G., can only jump a certain height (
Marr E.O. thinks he created the walls such that it is possible for Loo E.G. to complete the level, but he wants you to check. Marr E.O. provides his levels in a text format, where each symbol has a meaning:
- A dot
.
means there is nothing there, and Loo E.G. can move freely through that space. - A hash
#
represents the ground (last row of the input). - An at-symbol
@
represents the wall, which cannot be passed through or stood upon. - The letters
L
andG
are used to represent where Loo E.G. starts and ends respectively. The start point is guaranteed to be left of the end point. Both points are guaranteed one space above the ground.
Input Specification
The input will contain 10 datasets. Each dataset begins with a line containing three integers
Output Specification
For each dataset, output CLEAR
if Loo E.G. is able to complete the level, or a single integer
Sample Input (Two Datasets Shown)
2 10 5
..........
.......@..
.......@..
L......@.G
##########
1 10 5
..........
..@..@@...
..@.......
L.....@..G
##########
Sample Output
8
CLEAR
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments
can he jump above the map