You are given a grid of size 3*3 that has the following specifications:
- Each cell in the grid is either empty '.' or occupied '*'.
- you can't move to an occupied cell.
- Wesam starts at cell (1,1) and wants to reach Omar who is in cell (3,3).
- Wesam can move vertically, horizontally, and diagonally.
Note:If Wesam is standing at cell (x,y), he can go to :(x+1,y) , (x-1,y), (x,y+1) , (x,y-1), (x+1,y+1) , (x-1,y-1).
Note: rows are numbered from top to down, and columns are numbered from left to right.
Write a program to find if Wesam can reach Omar or not.
Input format:
- First line: T (number of test cases)
For each test case - 3 lines: 3 characters (denoting each cell in the grid.
It's guaranteed that cell (1,1) and cell (3,3) are empty.
Output format:
For each test case print "YES" (without quotes) if Wesam can reach Omar. Print "NO" (without quotes) otherwise.
Constraints
1<= T <= 100
In the first test:
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor