#K49922. Largest Garden Dimensions
Largest Garden Dimensions
Largest Garden Dimensions
You are given a rectangular plot of land with width (w) and height (h). You need to determine the dimensions of the largest possible rectangular garden that can be constructed inside the plot such that there is a margin of at least (x) units maintained on every side of the garden.
The garden's width and height are calculated as follows:
(\text{garden_width} = w - 2x)
(\text{garden_height} = h - 2x)
Ensure that your solution correctly handles cases where the margin might be zero or relatively large.
inputFormat
The input consists of a single line containing three space-separated integers: (w), (h), and (x), representing the width and height of the plot and the required margin, respectively. (0 \leq x \leq \min(w/2, h/2)).
outputFormat
Output two space-separated integers denoting the width and height of the largest possible garden that can be constructed.## sample
10 8 1
8 6