Chocolate Distribution
Limits: 2 sec., 512 MiB
This statement was translated automatically from Ukrainian.
Zenyk wants to prepare for a job interview, but for this, he needs a chocolate bar. The chocolate bar consists of \(n\) by \(m\) single chocolate squares. Mom taught Zenyk to always share, and Zenyk has exactly \(k\) friends. Taking advantage of a promotion, Zenyk bought two identical chocolate bars for the price of one, so he intends to divide one of the chocolate bars equally among all his friends. Zenyk can cut the chocolate bar horizontally and vertically between the squares as many times as he wants, but he cannot cut single squares. Will he succeed in dividing the chocolate bar equally among all his friends?
Input
The single line contains 3 integers \(n\), \(m\), \(k\) — the sizes of the chocolate bar and the number of Zenyk’s friends.
Output
Output Yes if Zenyk can divide the chocolate bar, and
No if he cannot.
Constraints
\(1 \le n, m \le 100\),
\(1 \le k \le 10000\).
Grading consists of the following subtasks:
1 point for each example from the statement,
7 points: \(k = 1\),
10 points: \(k \ge n \cdot m\),
20 points: \(n = 1\),
60 points: no additional constraints.
You will get the points for a subtask only if your program passes all tests in that subtask.
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 7 2 | Yes |
| Input (stdin) | Output (stdout) |
|---|---|
| 2 5 4 | No |
| Input (stdin) | Output (stdout) |
|---|---|
| 2 6 4 | Yes |
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|