#C865. Minimum Sprinklers Required

    ID: 52655 Type: Default 1000ms 256MiB

Minimum Sprinklers Required

Minimum Sprinklers Required

In this problem, you are given the dimensions of a garden represented by (X) rows and (Y) columns, along with a 2D matrix that specifies the water requirement for each cell (this matrix is provided for completeness but does not affect the sprinkler placement). In addition, you are given the effective area of a sprinkler, which covers (P) consecutive rows and (Q) consecutive columns. The task is to determine the minimum number of sprinklers required to cover the entire garden.

Mathematically, if (\lceil \frac{X}{P} \rceil) is the number of sprinklers needed in the row direction and (\lceil \frac{Y}{Q} \rceil) is the number in the column direction, then the total number required is the product of these two values, i.e., (\lceil \frac{X}{P} \rceil \times \lceil \frac{Y}{Q} \rceil).

inputFormat

The input is provided via standard input (stdin) in the following format:

(X) (Y) (P) (Q)
Next, there are (X) lines, each containing (Y) space-separated integers representing the garden matrix. Note that the matrix values are irrelevant for the computation and can be ignored.

For example, an input may look like:
4 5 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

outputFormat

For each test case, output a single integer on a new line representing the minimum number of sprinklers required to cover the garden. The output should be written to standard output (stdout).## sample

4 5 2 3
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
4

</p>