$k$ squares of a $m\times n$ gridded board are painted in such a way that the following property holds: If the centers of four squares are the vertices of a quadrilateral of sides parallel to the edges of the board, then at most two of these boxes must be painted.. Find the largest possible value of $k$.