#C2872. Maximum Flowers in Garden

    ID: 46236 Type: Default 1000ms 256MiB

Maximum Flowers in Garden

Maximum Flowers in Garden

In an n x m garden, you are to plant flowers such that no two flowers are adjacent (sharing a common edge). To maximize the number of planted flowers, a checkerboard pattern is used. This ensures that every flower is isolated from its neighbors. Your task is to compute the maximum number of flowers that can be planted in the garden under these conditions.

The optimal solution is to note that, by planting flowers on every alternate cell, the answer is equal to (\lceil\frac{n \times m}{2}\rceil).

inputFormat

The input is read from standard input (stdin) and consists of two positive integers n and m separated by a space representing the dimensions of the garden.

outputFormat

Output to standard output (stdout) a single integer representing the maximum number of flowers that can be planted under the given constraints.## sample

3 3
5