This is an interactive problem.
There is a grid of n×m cells. Two treasure chests are buried in two different cells of the grid. Your task is to find both of them. You can make two types of operations:
DIG r c: try to find the treasure in the cell (r,c). The interactor will tell you if you found the treasure or not.SCAN r c: scan from the cell (r,c). The result of this operation is the sum of Manhattan distances from the cell (r,c) to the cells where the treasures are hidden. Manhattan distance from a cell (r_1,c_1) to a cell (r_2,c_2) is calculated as ∣r_1−r_2∣+∣c_1−c_2∣.You need to find the treasures in at most 7 operations. This includes both DIG and SCAN operations in total. To solve the test you need to call DIG operation at least once in both of the cells where the treasures are hidden.