CF112B.Petya and Square
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Little Petya loves playing with squares. Mum bought him a square 2_n_ × 2_n_ in size. Petya marked a cell inside the square and now he is solving the following task.
The task is to draw a broken line that would go along the grid lines and that would cut the square into two equal parts. The cutting line should not have any common points with the marked cell and the resulting two parts should be equal up to rotation.
Petya wants to determine whether it is possible to cut the square in the required manner given the sizes of the square side and the coordinates of the marked cell. Help him.
小佩佳喜欢玩正方形。妈妈给他买了一个 2n×2n 大小的正方形。佩佳在正方形内部标记了一个格子,现在他正在解决如下问题:
该问题要求画一条折线,该折线需沿网格线行走,并将正方形分割成两个相等的部分。切割线不得与被标记的格子有任何公共点,且所得两部分应可通过旋转互相重合(即全等)。
佩佳希望判断:给定正方形边长(即 2n)以及被标记格子的坐标,是否能按上述要求完成切割?请帮助他。
输入格式
The first line contains three space-separated integers 2_n_, x and y (2 ≤ 2_n_ ≤ 100, 1 ≤ x, y ≤ 2_n_), representing the length of a square's side and the coordinates of the marked cell. It is guaranteed that 2_n_ is even.
The coordinates of the marked cell are represented by a pair of numbers x y, where x represents the number of the row and y represents the number of the column. The rows and columns are numbered by consecutive integers from 1 to 2_n_. The rows are numbered from top to bottom and the columns are numbered from the left to the right.
第一行包含三个以空格分隔的整数 2n、x 和 y(2 ≤ 2n ≤ 100,1 ≤ x, y ≤ 2n),分别表示正方形边长以及被标记单元格的坐标。保证 2n 为偶数。
被标记单元格的坐标由一对数字 x y 表示,其中 x 表示行号,y 表示列号。行与列均使用从 1 到 2n 的连续整数编号;行号从上到下递增,列号从左到右递增。
输出格式
If the square is possible to cut, print "YES", otherwise print "NO" (without the quotes).
如果正方形可以被切割,则输出 “YES”,否则输出 “NO”(不带引号)。
输入输出样例
输入#1
4 1 1
输出#1
YES
输入#2
2 2 2
输出#2
NO
说明/提示
A sample test from the statement and one of the possible ways of cutting the square are shown in the picture:

题目陈述中的一个样例测试以及切割正方形的一种可能方式如图所示:

输入解题思路,AI测评打分。不知道怎么写?