In the problem definition it says:
The first line will be two integers denoting the dimensions of the grid,
number of rows and number of columns. For consistency and shared point
I have read this as the first line size values are [sizeY] [sizeX] and not [sizeX] [sizeY]. Is this correct?
Also are all the other numbers Y,X as well? As the size in the example is square there is no way to tel,.