题干:

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⋅105and (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 llto rr inclusive.

If there are multiple solutions, print any of them.

If there exists no solution, print "NO".

Example

Input

1 8

Output

YES
2 7
4 1
3 8
6 5

解题报告:

别忘了输出YES。

AC代码:

#include<bits/stdc++.h>
#define ll long long
using namespace std;int main()
{ll l,r;cin>>l>>r;ll cur = l;printf("YES\n");for(ll i = 1; i<=(r-l+1)/2; i++) {printf("%lld %lld\n",cur++,cur++);} return 0;
}

【CodeForces - 1051B】Relatively Prime Pairs (构造,思维,素数,水题)相关推荐

  1. CodeForces - 1293C NEKO's Maze Game(思维,水题)

    题目链接:点击查看 题目大意:给出一个2*n大小的矩阵,现在有m次操作,每次操作将某一个方格的状态置反,这里的每个方块都有两种状态,一种状态是可通行状态,另一种是不可通行状态,初始时所有方块都是可通行 ...

  2. 【CodeForces - 1201C】Maximum Median(思维,水题)

    题干: You are given an array aa of nn integers, where nn is odd. You can make the following operation ...

  3. Codeforces//Good Bye 2013//A. New Year Candles 水题

    第一次在Codeforces上提交题,全是英文,啊.应该是场比赛,WA了两次,丫的.哎,什么时候才能不做水题了呢.Happy New Year!Zhou Ping!努力奋斗! 题目链接:A. New ...

  4. CodeForces - 1265D Beautiful Sequence(贪心+构造+思维)

    题目链接:点击查看 题目大意:给出a个0,b个1,c个2,d个3,要求构造一种序列,使得数列两两之间绝对值之差等于1,若不能构造输出NO 题目分析:首先我们需要稍微讨论一下特殊情况,那就是对于两端的数 ...

  5. CodeForces - 798D Mike and distribution(构造+思维/玄学随机数)

    题目链接:点击查看 题目大意:给出两个长度为n的数列,现在要求选出n/2+1个位置,使得两个序列中这些位置的和分别大于各自序列之和的一半 题目分析:题意换句话说,是需要让我们从数组中选出一半,要大于另 ...

  6. CodeForces - 1305D Kuroni and the Celebration(思维,互动题)

    题目链接:点击查看 题目大意:给出一个由 n 个点组成的树,现在可以询问 n/2 次(向下取整)LCA,确定根节点是哪个节点 题目分析:因为最多只能求 n/2 次lca,每次需要两个节点作为参数,也就 ...

  7. CodeForces - 1263A Sweet Problem(思维,水题)

    题目链接:点击查看 题目大意:给出三种颜色的糖果,分别表示为r,g,b,现在Tanya每天可以吃两个不同颜色的糖果,问最多可以吃多少天 题目分析:大水题一个,但自己真的蠢,一开始思路混乱,写了一大堆乱 ...

  8. CodeForces - 1228B Filling the Grid(思维,水题)

    题目链接:点击查看 题目大意:给出一个n*m的矩阵,每个格子可以涂成黑色或白色,再给出n个数a[i]以及m个数b[i],a[i]表示第i行前a[i]个格子都是黑色的,第a[i]+1个数是白色的,其余的 ...

  9. C - Internet Address CodeForces - 245B(有些思维的水题)

    Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote ...

  10. 【CodeForces - 674B 】Bear and Two Paths(贪心,思维,水题)

    题干: 第一行给出N和M代表有N个难度1~N的题目,M代表有M个约束.接下来M行,每行两个数代表这一个约束的两个题目. 代表难度的数字越大,题目越难.现在要求你将N个题目分成不重不漏的两组(div1和 ...

最新文章

  1. sql镶嵌查询_sql数据库的嵌套查询
  2. 拥抱开源,Office 365开发迎来新时代
  3. android软件开发考试,Android软件工程师笔试题(全选择题)【0-1年经验】
  4. react实现svg实线、虚线、方形进度条
  5. 做红颜知己就要恪守界限
  6. java 自定义对象 排序,使用自定义排序顺序对对象的ArrayList进行排序
  7. python高频词_python几万条微博高频词分析
  8. 2020微博用户发展报告
  9. 基于C4.5神经网络集成
  10. 使用客户端登陆ftp 500 OOPS: cannot change directory:/home/virftp解决
  11. 随想录(vc仿真下的嵌入式开发)
  12. 白英彩 计算机组成原理,国家教委关于批转试行全国考委高等教育自学考试电气工程、电子技术、计算机及其应用三个专业专科考试计划的通知...
  13. vs2008 sp1补丁安装到最后一点点的时候,就无法安装下去了 解决方法[转]
  14. 淘宝镜像(浏览器驱动等等等)
  15. js获取多叉树的广度和深度
  16. 在浏览器中输入URL(如www.baidu.com)到显示页面经历哪些过程,涉及到哪些协议?
  17. 【JSP】关于The JSP specification requires that an attribute name is preceded by whitespace
  18. 6.2_[Java 数组]-利用二重循环打印各种图形
  19. 小企业仓库管理软件设计开发
  20. java domino 单点登录_Domino单点登录LTPAtoken生成原理

热门文章

  1. 【数据结构与算法】数组与链表
  2. 轻量级锁_并发编程实战05:锁的状态
  3. mysqlnavicat数据库备份与恢复_Navicat如何还原MySQL数据库
  4. oracle sql-1,Oracle – Oracle SQL(1)
  5. python enumerate_Python中enumerate用法详解
  6. c++builder 运行网站的api_04 将您的API Builder Docker映像发布到AMPLIFY运行时服务(ARS)...
  7. L2-002 链表去重 (25 分) 船新方法
  8. C# 串口接收1次数据会进入2次串口接收事件serialPort1_DataReceived,第2次进入时串口缓冲区为空
  9. 发那科pmc地址分配_一台全新的FANUC数控机床,请简述有挡块回参功能的实现步骤?包括PMC的I/O分配、具体参数设定、梯形图程序...
  10. es6遍历树结构并判断_ES6和ES5中数据结构的遍历