题库练习 The Cake Is a Lie
← 上一题 下一题 →

A14182 | The Cake Is a Lie

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

There is a $n \times m$ grid. You are standing at cell $(1, 1)$ and your goal is to finish at cell $(n, m)$ .

You can move to the neighboring cells to the right or down. In other words, suppose you are standing at cell $(x, y)$ . You can:

- move right to the cell $(x, y + 1)$ — it costs $x$ burles;
- move down to the cell $(x + 1, y)$ — it costs $y$ burles.

Can you reach cell $(n, m)$ spending exactly $k$ burles?

输入格式

The first line contains the single integer $t$ ( $1 \le t \le 100$ ) — the number of test cases.

The first and only line of each test case contains three integers $n$ , $m$ , and $k$ ( $1 \le n, m \le 100$ ; $0 \le k \le 10^4$ ) — the sizes of grid and the exact amount of money you need to spend.

输出格式

For each test case, if you can reach cell $(n, m)$ spending exactly $k$ burles, print YES. Otherwise, print NO.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).

输入输出样例

输入 #1
6
1 1 0
2 2 2
2 2 3
2 2 4
1 4 3
100 100 10000
输出 #1
YES
NO
YES
NO
YES
NO
C++ 编辑器
输入
输出