#K89047. Planting Trees

    ID: 37443 Type: Default 1000ms 256MiB

Planting Trees

Planting Trees

Given a rectangular field of dimensions M x N, you are to determine the maximum number of trees that can be planted such that each tree is at least K meters apart both horizontally and vertically. The trees are arranged in a grid pattern, and the spacing between any two trees in the same row or column is exactly K meters.

This means that in each row you can plant at most \(\left\lfloor \frac{N}{K} \right\rfloor\) trees and in each column at most \(\left\lfloor \frac{M}{K} \right\rfloor\) trees. The answer is the product of the two values:

\(\text{answer} = \left\lfloor \frac{M}{K} \right\rfloor \times \left\lfloor \frac{N}{K} \right\rfloor\)

inputFormat

The input consists of a single line containing three space-separated integers: M (the number of meters in the vertical direction), N (the number of meters in the horizontal direction), and K (the spacing required between the trees).

outputFormat

Output a single integer representing the maximum number of trees that can be planted in the field.

## sample
15 10 3
15