Drilling Kevin
We caught Kevin! Now we have to get a written confession out of him.
In order to do this, we need to interrogate him, where Kevin's psychological state is modelled as a coordinate on a 2D Cartesian plane. Initially Kevin is calm, starting at the origin
To extract a confession, we must drill Kevin with a series of intense questions. We have to manipulate his psychological state to reach exactly the breaking point, located at the coordinates
Every time we ask a question, Kevin's mental state shifts by exactly unit in one of the four directions: up, down, left, or right.
Unfortunately, due to the Kiriakou Law, our interrogation must last exactly questions. We cannot stop the interrogation early.
If Kevin reaches the breaking point before the th question, we must continue asking questions.
Given the coordinates of the breaking point and the required number of questions
, determine if it is possible for Kevin's psychological state to land exactly on
after exactly
questions.
Input
The input consists of a single line containing three integer ,
, and
(
)
Output
Output Yes if you can land exactly on the breaking point after questions. Otherwise, output
No.
Example
Input 1
1 1 2
Output 1
Yes
You need to reach in exactly
questions. You can shift right to
, and then shift up to
on the second, using up the
questions. Therefore, the output is
Yes.
Input 2
10 0 5
Output 2
No
Clearly, the breaking point is too far to reach in exactly
questions.
Input 3
0 3 4
Output 3
No
This time, we can reach the breaking point , but we much reach it in exactly
questions, which is impossible.
Comments