Educational Codeforces Round 51 (Rated for Div. 2 B. Relatively Prime Pairs

题目大意:给出一个区间[l,r],保证r-l(r>l)是奇数,要求成对输出区间内的数,并确保这对数互素
题目链接:http://codeforces.com/contest/1051/problem/B
c++代码:

#include <iostream>

using namespace std;

typedef long long LL;

int main() {
	LL l,r;
	cin >> l >> r ;
	cout <<"YES" <<endl;
	for(LL i=l;i<r;i+=2)
	{
		cout << i <<" " <<i+1 <<endl;
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_39475280/article/details/82930335