The central square of the City of Mathematicians is an $n\times n$ rectangular shape, each paved with $1\times 1$ tiles. In order to illuminate the square, night lamps are placed at the corners of the tiles (including the edges of the rectangle) in such a way that each night lamp illuminates all the tiles in its corner.
Determine the minimum number of night lamps such that even if one of those night lamps does not work, it is possible to illuminate the entire central square with them.

**
   - For odd \( n \), the minimum number of lamps required is \(\frac{(n+1)^2}{2}\).
   - For even \( n \), the solution involves a specific pattern that ensures each tile has at least two lamps on its corners.

The final answer is \( \boxed{ \frac{(n+1)^2}{2} } \) for odd \( n \). For even \( n \), refer to the specific pattern from Cono Sur 2011 P6.