Our topper nerd, Vinay is learning how to play Chess. Being a noobie, he is fascinated by the moves and attacks of a Rook (aka Tower). The rook moves horizontally or vertically, through any number of unoccupied squares. This is a Rook -
In the given sample problem, a 2 x 2 chess board is given alongwith the positions of the pieces on the board in the line 3 & 4. As, there is only one rook present at (1,0) row 1 and column 0 are all made 0. And, the elements that do not belong in these rows and columns are printed in the output as it is.