A. Dasha and Stairs
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

On her way to programming school tiger Dasha faced her first test — a huge staircase!

The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is possible that it has something to do with their color. So on some interval of her way she calculated two values — the number of steps with even and odd numbers.

You need to check whether there is an interval of steps from the l-th to the r-th (1 ≤ l ≤ r), for which values that Dasha has found are correct.

Input

In the only line you are given two integers a, b (0 ≤ a, b ≤ 100) — the number of even and odd steps, accordingly.

Output

In the only line print "YES", if the interval of steps described above exists, and "NO" otherwise.

Examples
Input
2 3
Output
YES
Input
3 1
Output
NO
Note

In the first example one of suitable intervals is from 1 to 5. The interval contains two even steps — 2 and 4, and three odd: 1, 3 and 5.

 #include <iostream>
#include <cmath>
using namespace std; int main()
{
int a, b;
cin >> a >> b;
if(a == && b == )
{
cout << "NO" << endl;
}
else if(abs(a - b) <= )
{
cout << "YES" << endl;
}
else cout << "NO" << endl;
return ;
}

761A Dasha and Stairs的更多相关文章

  1. Codeforces Round #394 (Div. 2) A. Dasha and Stairs 水题

    A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to prog ...

  2. Codeforces761A Dasha and Stairs 2017-02-05 23:28 114人阅读 评论(0) 收藏

    A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. Codeforces Round #394 (Div. 2) A. Dasha and Stairs

    A. Dasha and Stairs time limit per test:2 seconds memory limit per test:256 megabytes input:standard ...

  4. 【codeforces 761A】Dasha and Stairs

    time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  5. CF761A Dasha and Stairs 题解

    Content 给定两个数 \(n,m\),试问是否有区间里面有 \(n\) 个奇数和 \(m\) 个偶数. 数据范围:\(0\leqslant n,m\leqslant 100\). Solutio ...

  6. CODEFORCES ROUND #761 ANALYSES BY TEAM:RED & BLACK

    A. Dasha and Stairs Problems: 一个按照1,2,3……编号的楼梯,给定踩过的编号为奇数奇数和偶数的楼梯数量a和b,问是否可以有区间[l, r]符合奇数编号有a个,偶数编号有 ...

  7. Codeforces Round #394 (Div. 2) A,B,C,D,E

    A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  8. Codeforces Round #394 (Div. 2)A水 B暴力 C暴力 D二分 E dfs

    A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  9. Div.2 C. Dasha and Password

    C. Dasha and Password time limit per test 2 seconds memory limit per test 256 megabytes input standa ...

随机推荐

  1. Nature | 光学CNN层替换传统CNN层,超省电

    CNN 计算效率的研究一直备受关注,但由于功率和带宽的严格限制,CNN 仍难以应用在嵌入式系统如移动视觉.自动驾驶中.在斯坦福大学发表在 Nature 旗下 Scientific Reports 的这 ...

  2. Noip知识点备考

    作为一个oier,适当的整理是有必要的.蒟蒻根据自己的理解,筛选出考noip应当掌握的知识点.可能后期还有解题思路和模板,先挖个坑慢慢补呗. 60级张炳琪Noip知识点总结 可能是本人比较弱,写的内容 ...

  3. Ubuntu 提权漏洞(CVE-2019-7304)复现

    漏洞描述: Ubuntu 版本: Ubuntu 18.10 Ubuntu 18.04 LTS Ubuntu 16.04 LTS Ubuntu 14.04 LTS 2.28 < snapd < ...

  4. X86、X64和X86_64区别

        x86是指intel的开发的一种32位指令集,从386开始时代开始的,一直沿用至今,是一种cisc指令集,所有intel早期的cpu,amd早期的cpu都支持这种指令集,ntel官方文档里面称 ...

  5. pdb调试工具

    调试--pdb pdb是基于命令行的调试工具,非常类似gnu的gdb(调试c/c++). 命令 简写命令 作用 break b 设置断点 continue c 继续执行程序 list l 查看当前行的 ...

  6. Spring MVC 学习笔记1 - First Helloworld by Eclipse【& - java web 开发Tips集锦】

    Spring MVC 学习笔记1 - First Helloworld by Eclipse reference:http://www.gontu.org 1. 下载 Spring freamwork ...

  7. jdk配置(备份)

    #####set java environment #export JAVA_HOME=/usr/java/jdk1..0_172 #export JRE_HOME=${JAVA_HOME}/jre ...

  8. HTML5 借助http请求发送formdata对象,从而上传文件 XMLHttpRequest, FormData

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  9. 12.使用default-Action配置统一访问

    转自:https://wenku.baidu.com/view/84fa86ae360cba1aa911da02.html default-action-ref,当访问没有找到对应的action时,默 ...

  10. Mysql canal 监控数据变化

    https://www.jianshu.com/p/6299048fad66 阿里巴巴github地址 https://github.com/alibaba/canal/wiki/QuickStart