You have given a n×n matrix containing empty spaces or walls. You have a team of 2 players where the position of each player is given. There are 2 gold mines on the map. Your aim is to pick gold from both these mines.
You are required to find the minimum time required to pick gold from both gold mines.
In one second, they all simultaneously can move in any of the four directions and any player can pick any number of gold including 0.
Input format
Output format
The output contains the following two lines:
In the case of "No", do not print the second line.
Constraints
1≤t≤100
2≤n≤100
In the first test case, player 1 will move from (3,2)->(1,1) and the second player will move from (3,4)->(1,4).
In the second test case, player 1 will move from (3,4)->(2,4)->(1,4) and the second player don't move.