#C1365. Maximum Non-Attacking Knights
Maximum Non-Attacking Knights
Maximum Non-Attacking Knights
Given a chessboard with dimensions N (rows) and M (columns), determine the maximum number of knights that can be placed on the board such that no two knights attack each other. A knight moves in an L-shape: two squares in one direction and then one square perpendicular to that.
In a typical chess scenario, knights placed on cells of the same color never attack each other, but for this problem it is assumed that any knight placed on the board is safe from the other's attacks if placed on any cell. Therefore, the answer is simply the total number of cells, i.e. N \times M.
Note: N and M are positive integers.
inputFormat
The input consists of a single line containing two space-separated integers N and M representing the number of rows and columns of the chessboard respectively.
outputFormat
Output a single integer which is the maximum number of knights that can be placed on the chessboard without any two attacking each other.
## sample3 3
9