#CCBCHBA0000108. Đếm ô theo màu bàn cờ (Count Chessboard-Color Cells)
Đếm ô theo màu bàn cờ (Count Chessboard-Color Cells)
Count Chessboard-Color Cells
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given an -by- grid with 1-based indices, count cells satisfying . Cell is included. Count each cell once.
Input
One line contains (rows and columns).
Output
Print the cell count.
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
2 3
Output:
3
Explanation:
The 2×3 grid has 3 even-sum cells, including the top-left cell.
Example 2
Input:
1 1
Output:
1
Explanation:
The 1×1 grid has 1 even-sum cells, including the top-left cell.