time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Little Petya loves playing with squares. Mum bought him a square 2n × 2n 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.

Input

The first line contains three space-separated integers 2nx and y (2 ≤ 2n ≤ 100, 1 ≤ x, y ≤ 2n), representing the length of a square's side and the coordinates of the marked cell. It is guaranteed that 2n 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 yrepresents the number of the column. The rows and columns are numbered by consecutive integers from 1 to 2n. The rows are numbered from top to bottom and the columns are numbered from the left to the right.

Output

If the square is possible to cut, print "YES", otherwise print "NO" (without the quotes).

Sample test(s)
input
4 1 1

output
YES

input
2 2 2

output
NO

Note

A sample test from the statement and one of the possible ways of cutting the square are shown in the picture:

解题说明:此题是给定一个大正方形中的一个单位块,要求找出一条不与这个单位块有任何公共点的线把该正方形等分为两个形状一样的块。我们都知道如果要二等分一个三角形,无论这条分割线是什么样子的,它肯定会经过正方形的重心,于是这里只要判断这个单位块是不是与重心有公共点即可,也就是判断此块是不是围绕重心的四个小块。

#include <iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;int main()
{int n,x,y;scanf("%d %d %d",&n,&x,&y);if((x==n/2||x==n/2+1)&&(y==n/2||y==n/2+1)){printf("NO\n");}else{printf("YES\n");}return 0;
}

B. Petya and Square相关推荐

  1. 渐进式web应用程序_如何使用渐进式Web应用程序更快,更便宜地构建新应用程序...

    渐进式web应用程序 You need an app! The question is- which kind? 您需要一个应用程序! 问题是--哪种? For the last 8 years or ...

  2. javascript模块_6分钟内您需要了解的有关Javascript模块的所有信息

    javascript模块 Note: This post is inspired by and is a summary of this excellent 30-minute video by Ty ...

  3. Windows上视频的tensorflow对象检测10

    Previous article: "TensorFlow Object Detection in Windows (under 30 lines)", covers about ...

  4. webp图像扩展_WebP图像和性能

    webp图像扩展 It's said that a picture is worth a thousand words, but online, a picture can be worth a th ...

  5. Petya and Countryside

    Description Little Petya often travels to his grandmother in the countryside. The grandmother has a ...

  6. 367. Valid Perfect Square

    题目: Given a positive integer num, write a function which returns True if num is a perfect square els ...

  7. 数据挖掘公司D square nv 完成500万欧元B轮融资

    D square nv日前完成 500 万欧元 B 轮融资,融资方为 Gemma Frisius Fonds, Jürgen Ingels, Limburgse Reconversie Maatsch ...

  8. 经典算法题之Maximal Square

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 作者:叶    虎 Maximal Square是道非常有意思的算 ...

  9. Codeforces 895C - Square Subsets

    895C - Square Subsets 思路:状压dp. 每个数最大到70,1到70有19个质数,给这19个质数标号,与状态中的每一位对应. 状压:一个数含有这个质因子奇数个,那么他状态的这一位是 ...

最新文章

  1. python内置函数sorted(x)的作用是_Python内置filter与sorted函数
  2. UVa1388 - Graveyard
  3. [问题解决] File /struts-tags not found
  4. java防止表单二次提交_防止表单重复提交
  5. Python:利用python语言绘制多个子图经典案例、代码实现之详细攻略
  6. 位运算和时间复杂度的分析
  7. Python 绘图问题:Matplotlib中plt.rcParams[]使用方法 rcsetup.py matplotlibrc
  8. 如何在 .NET Core 中获取 CPU 使用率
  9. 常哥带你认识NoSQL和Redis的强大
  10. python爬虫编码转换_Python 爬虫遇到形如 小说 的编码如何转换为中文? - SegmentFault 思否...
  11. python idle打不开_孩子,给你的Python安个家吧!
  12. 推荐系统知识梳理——GBDTLR
  13. winfrom 去掉字符串空格
  14. 具体数学-第3课(递归式转化为求和求解)
  15. C语言队列(排队)先进先出.实现全部函数
  16. R语言apply族函数详解
  17. 浅析SkipList跳跃表原理及代码实现
  18. img标签,hr标签
  19. 中国机器视觉产业全景图谱
  20. python如何表示小数_小数的定点表示(附python程序)

热门文章

  1. 专注于自媒体短视频领域四年后的运营问题汇总-第二集
  2. 永善男士护肤管理中心怎么样
  3. 将手机或者平板变成电脑的第二屏幕
  4. Charles —— iOS抓包设置代理的坑
  5. Java语言程序设计期考重点复习范围-选择题
  6. 通过DHCP获取IP地址,使相关PC可以互相访问
  7. 2021最新去水印小程序源码
  8. php基础(09):php模板引擎Smarty
  9. 关闭IDEA保存代码自动删除末尾空格
  10. http://blog.csdn.net/a9529lty/article/details/6454145