#C7084. Can Plant Flowers?

    ID: 50916 Type: Default 1000ms 256MiB

Can Plant Flowers?

Can Plant Flowers?

This problem involves determining whether it is possible to plant flowers in a rectangular garden grid while satisfying Lisa's constraints. You are given a garden of size R \times C along with F available flower colors.

The minimum number of colors required is defined as follows:

$$ min\_required = \begin{cases} 2, & \text{if } R=1 \text{ or } C=1,\\ 3, & \text{if } R > 1 \text{ and } C > 1. \end{cases} $$

For each test case, if F is greater than or equal to min_required, output Yes; otherwise, output No.

inputFormat

The first line contains an integer T representing the number of test cases. Each of the following T lines contains three space-separated integers: R, C, and F, where R and C denote the number of rows and columns of the garden grid, and F denotes the number of available flower colors.

outputFormat

For each test case, print a single line with either Yes if it is possible to plant the garden according to the constraints, or No if it is not.## sample

3
3 3 2
4 4 2
4 4 3
No

No Yes

</p>