|
|||
Prison BreakA prison has been built as a labyrinth.
The labyrinth is composed of huts labelled The labyrinth can be considered as a rectangle of huts of width W and length L. W and L are integers. A hut is identified by its position on the horizontal side and vertical side of the labyrinth. In this prison, all huts are “entry huts”, but there is only one “exit hut”. Given the labyrinth, the hut of the prisoner (called entry hut) and the exit hut, your task is to determine if the prisoner can escape. In the example of Prison A (a labyrinth of length 4 and width 2), the prisoner can escape. In the second example (a labyrinth of length 3 and width 2), the prisoner cannot escape.
Input SpecificationThe first line of the input contains a single integer P, which is the number of data sets that follow. Each data set begins with a single line made up of 6 natural numbers in the form L W A B C D, where
This line is followed by W lines, each containing L characters. Each
character will be Output Specification
For each prison, print “ Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |