B. Relatively Prime Pairs

time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

You are given a set of all integers from ll to rr inclusive, l<rl<r, (r−l+1)≤3⋅105(r−l+1)≤3⋅105 and (r−l)(r−l) is always odd.

You want to split these numbers into exactly r−l+12r−l+12 pairs in such a way that for each pair (i,j)(i,j) the greatest common divisor of ii and jj is equal to 11. Each number should appear in exactly one of the pairs.

Print the resulting pairs or output that no solution exists. If there are multiple solutions, print any of them.

Input

The only line contains two integers ll and rr (1≤l<r≤10181≤l<r≤1018, r−l+1≤3⋅105r−l+1≤3⋅105, (r−l)(r−l) is odd).

Output

If any solution exists, print "YES" in the first line. Each of the next r−l+12r−l+12 lines should contain some pair of integers. GCD of numbers in each pair should be equal to 11. All (r−l+1)(r−l+1) numbers should be pairwise distinct and should have values from ll to rr inclusive.

If there are multiple solutions, print any of them.

If there exists no solution, print "NO".

Example

input

Copy

1 8

output

Copy

YES
2 7
4 1
3 8
6 5
#include<bits/stdc++.h>
using namespace std;
int main()
{ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);long long l,r;while(cin>>l>>r){cout<<"YES"<<endl;for(long long i=l;i<=r;i+=2){cout<<i<<' '<<i+1<<endl;}}return 0;
}

Educational Codeforces Round 51 (Rated for Div. 2).B. Relatively Prime Pairs(水题)相关推荐

  1. Educational Codeforces Round 90 (Rated for Div. 2)(A, B, C, D, E)

    Educational Codeforces Round 90 (Rated for Div. 2) Donut Shops 思路 分三种情况: a==c/ba == c / ba==c/b这个时候两 ...

  2. Educational Codeforces Round 133 (Rated for Div. 2)(CD题解)

    Educational Codeforces Round 133 (Rated for Div. 2)CD题解 过AB补CD C. Robot in a Hallway 题意 题意:现有 2∗m 的方 ...

  3. Educational Codeforces Round 100 (Rated for Div. 2)

    文章目录 Educational Codeforces Round 100 (Rated for Div. 2) A. Dungeon B. Find The Array C. Busy Robot ...

  4. Educational Codeforces Round 104 (Rated for Div. 2) A,B,C,D,E

    Educational Codeforces Round 104 (Rated for Div. 2) A,B,C,D,E A - Arena 题意 nnn 个英雄,他们的等级分别是 a1,a2,-, ...

  5. Educational Codeforces Round 114 (Rated for Div. 2) (A ~ F)全题解

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 Educational Codeforces Round 114 (Rated for Div. 2) ...

  6. Educational Codeforces Round 106 (Rated for Div. 2)(A ~ E)题解(每日训练 Day.16 )

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 Educational Codeforces Round 106 (Rated for Div. ...

  7. Educational Codeforces Round 37 (Rated for Div. 2) 1

    Educational Codeforces Round 37 (Rated for Div. 2) A.Water The Garden 题意:Max想给花园浇水.花园可被视为长度为n的花园床,花园 ...

  8. Educational Codeforces Round 89 (Rated for Div. 2)(A, B, C, D)

    Educational Codeforces Round 89 (Rated for Div. 2) A. Shovels and Swords 思路 题意非常简单,就是得到最多的物品嘛,我们假定a, ...

  9. Educational Codeforces Round 114 (Rated for Div. 2) D. The Strongest Build 暴力 + bfs

    传送门 文章目录 题意: 思路: 题意: 你有nnn个装备槽,每个槽里面有cic_ici​个力量加成,对于每个槽只能选一个力量加成,现在给你mmm个力量组合[b1,b2,...,bn][b_1,b_2 ...

  10. Educational Codeforces Round 72 (Rated for Div. 2) D. Coloring Edges dfs树/拓扑找环

    传送门 文章目录 题意: 思路: 题意: 给你一张图,你需要给这个图的边染色,保证如果有环那么这个环内边的颜色不全相同,输出染色方案和用的颜色个数. n,m≤5e3n,m\le5e3n,m≤5e3 思 ...

最新文章

  1. Linux~Sh脚本一点自己的总结
  2. C++ void类型指针的使用
  3. [YTU]_1046 ( 输入10个数字,然后逆序输出)
  4. 技术面试问项目难题如何解决的_【知识】同轴线如何当quot;网线quot;使用?解决改造项目中难题...
  5. Ubuntu怎么截图?一些快捷键备忘
  6. 编程也讲禅,您读过《金刚经》吗?——ADO.NET核心类的灭度与SQLHelper的诞生——十八相送(上)...
  7. 欧路词典如何导入html,[转载]如何用欧路词典背单词?
  8. 土豆运行linux,安装到土豆上的 Linux 是怎么个意思?
  9. 中英文金额大写转换器
  10. 《奥黛丽·赫本》一辈子活在优雅里
  11. X-FRAME-OPTIONS 出现两个或多个的原因
  12. 小马哥----高仿苹果6S A235刷机拆机图与开机界面图 真八核6735芯片 精仿系列机
  13. 8卡gpu服务器是8个芯片,北京8卡GPU服务器厂商
  14. 四年级计算机下册word教学设计,小学教学四年级教案下册计算机教案-20210723143637.docx-原创力文档...
  15. 快速查看Mac下软件的所有快捷键— CheatSheet
  16. Django cms 教程三:创建模板
  17. php拼音排序,php数组按拼音顺序排序的方法详解
  18. linux装机必备软件
  19. 全栈工程师之路---2018最全web开发路线图
  20. ibm tivoli_使用IBM Tivoli Access Manager实施密码到期提醒

热门文章

  1. Intent基本概念
  2. 电脑显示受限制无连接应该怎么办
  3. 计算机网络期中考试题周静,zj474~093期中考试反思
  4. 菜鸡程序员是如何写代码的?
  5. 1980年红色1元纸币值多少钱?
  6. 诡异事件:天翼云主机CentOS8.2配置RedisServer5.0.3无法启动
  7. 简单谈谈我所理解的货币发展史
  8. css样式的灵异事件
  9. Dreamweaver中如何设定文字——大小、字体、颜色
  10. scratch编程 飞翔的小鸟 开发笔记 0604