Bishops on Black
Medium
Execution time limit is 0.2 seconds
Runtime memory usage limit is 64 megabytes
We have a chessboard with dimensions M x N squares, where the bottom-left square is black. Determine the maximum number of bishops that can be placed on the black squares of this board such that no two bishops can attack each other. Remember, bishops attack each other if they are positioned on the same diagonal.
Input
The input consists of natural numbers 1 ≤ M, N ≤ 10^9.
Output
Provide the maximum number of bishops that can be placed under the given conditions.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 5%