Jumping Jack
Jack can jump in two different ways. He can jump 1 step forward and l steps left, or he can jump 1 step forward and r steps right. He wants to end up m steps directly infront of where he started. Is this possible?
Input
The first line contains three integers, l, r and m.
Output
Output a line containing Yes or No, stating whether it is possible for Jack
to end up exactly m steps forward.
Constraints
- 1≤l,r,m≤1000
Example 1
2 3 5
Yes
Example 2
2 3 6
No
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.