#C1978. L-Tromino Tiling Puzzle
L-Tromino Tiling Puzzle
L-Tromino Tiling Puzzle
You are given an integer N and two integers x and y representing the coordinates of a missing tile in a 2^N × 2^N
board. The board has exactly one square missing. The task is to determine whether the board can be completely covered using L-shaped tromino tiles (each tile covers exactly three squares) without overlapping and without covering the missing square.
It is known that a board of size 2^N × 2^N with one missing square can always be tiled with L-shaped trominoes. In mathematical terms, given that the board size is \(2^N \times 2^N\) and one cell is removed, there exists a tromino tiling covering all remaining squares. Your program should output YES
if the tiling is possible, and NO
otherwise.
Note that in this problem, the input parameters are guaranteed to be valid, and the tiling is always possible. Therefore, the correct output for any valid input is YES
.
inputFormat
The input is read from stdin and consists of a single line with three space-separated integers:
N
(the exponent for the board size; the board is of size \(2^N \times 2^N\))x
(the x-coordinate of the missing tile)y
(the y-coordinate of the missing tile)
It is guaranteed that 0 ≤ x, y < 2^N
.
outputFormat
Output a single line to stdout containing YES
if the board can be completely tiled with L-shaped tiles, otherwise output NO
.
2 1 1
YES