Cramped but Not Offended
Time limit2sMemory limit1024 MB
Given an n by m room and a target p, decide whether two cuts can split the room into three rectangles whose perimeters sum to p.
- Level
Medium4 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Statement
The hotel has recently grown popular, and there are not enough rooms. Count Dracula decided to split one of its large old rooms into three new ones.
The old room is a rectangle with length and width . The count wants to divide it into three new rectangular rooms with integer side lengths, so that the sum of the perimeters of the new rooms equals .
Help Dracula determine whether the room can be divided this way.
Input
A single line contains three integers , , and separated by spaces ().
Output
Print YES if the room can be divided into three new rooms, otherwise print NO.