Consider a garden represented as an n×m grid, where each unit cell has dimensions of 1×1 and contains a pot. The rows are numbered from 0 to n−1 from top to bottom. The columns are numbered from 0 to m−1 from left to right. Some of these pots within the garden have been broken. The objective is:
We denote the cell on the ith(0≤i≤n−1) row and jth(0≤j≤m−1) column by (i,j).
Input format
Output format
In a new line print 2 space-separated integers representing the maximum number of plants that can be strategically planted and the minimum number of plants required for effective coverage, respectively.
Constraints
1≤n,m≤25000≤b≤1040≤i<n0≤j<m
Up to four plants can be planted in the garden:
PBPP∗P
However, it is possible for three plants to occupy the garden:
PBP∗P∗
Here, P is the cell where the plant is planted, B is broken pot, and ∗ represented pots without plants.