Loading repovive.com/contests/2/problems/A
You are given an chessboard. You must place exactly rooks on distinct cells.
A cell is called threatened if there exists at least one rook in the same row or in the same column (the cell may also contain a rook).
For each test case, find the minimum possible number of threatened cells.
Put the rooks at and .
Then all cells in row are threatened, and all cells in columns and are threatened.
So the only safe cells are and (all other cells are threatened).
Put the rooks at , , and .
Then all cells in rows and are threatened, and all cells in columns and are threatened.
So the only safe cell is (the other cells are threatened).