题意与分析

图论基础+思维题。

代码

#include <bits/stdc++.h>
#define MP make_pair
#define PB emplace_back
#define fi first
#define se second
#define ZERO(x) memset((x), 0, sizeof(x))
#define ALL(x) (x).begin(),(x).end()
#define rep(i, a, b) for (repType i = (a); i <= (b); ++i)
#define per(i, a, b) for (repType i = (a); i >= (b); --i)
#define QUICKIO \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
using namespace std;
using ll=long long;
using repType=int; int main()
{
int k; cin>>k;
if(k%2==0) cout<<"NO"<<endl;
else
{
cout<<"YES"<<endl;
cout<<4*k-2<<" "<<2*k*(k-1)+k<<endl;
cout<<1<<" "<<2<<endl;
rep(i,3,3+k-1-1) cout<<1<<" "<<i<<endl;
rep(i,k+2,k+2+k-1-1) cout<<2<<" "<<i<<endl; // k+2 ~ 2*k
rep(i,3,3+k-1-1)
{
rep(j,2*k+1,2*k+1+k-1-1) // 2*k+1 ~ 3*k-1
{
cout<<i<<" "<<j<<endl;
}
}
rep(i,k+2,2*k)
{
rep(j,3*k,3*k+k-1-1) // 3*k ~ 4*k-2
{
cout<<i<<" "<<j<<endl;
}
}
for(int i=2*k+1;i<=3*k-1;i+=2)
{
cout<<i<<" "<<i+1<<endl;
}
for(int i=3*k;i<=4*k-2;i+=2)
{
cout<<i<<" "<<i+1<<endl;
} }
return 0;
}

最新文章

  1. Linux入门之路
  2. postgresql+slony-i安装配置主从
  3. KnockoutJS 3.X API 第四章 表单绑定(8) submit、enable、disable绑定
  4. mysql中变量赋值
  5. PHP设计模式(一)
  6. POJ 3628 Bookshelf 2【01背包】
  7. enumerate
  8. OC6_代理的基本概念
  9. Project Euler 77:Prime summations
  10. jqueryeasyui中文乱码问题
  11. C语言基础学习运算符-赋值运算符
  12. 线段树解决leetcode307. Range Sum Query - Mutable
  13. 缩放系列(一):一个很好的bitmap手势缩放demo(多点触控)
  14. Ubuntu里字符编码设置
  15. lufylegend库 LBitmapData LBitmap LSprite
  16. C#访问C++动态分配的数组指针
  17. 浏览器输入url回车后,会发生什么?
  18. hbase单机版安装+phoneix SQL on hbase 单节点安装
  19. Linux下密码抓取神器mimipenguin
  20. ORA-01552 非系统表空间不能使用系统回滚段处理

热门文章

  1. PHP数组和字符串相互转换以及判断字符串长度
  2. Mysql优化实践(分页优化)
  3. mac终端terminal快捷键
  4. building for production...Killed
  5. POJ 1328 Radar Installation(很新颖的贪心,区间贪心)
  6. Impossible WHERE noticed after reading const tables
  7. Python 学习笔记(九)Python元组和字典(三)
  8. 20181030NOIP模拟赛T3
  9. centos7.3上编译安装percona5.7.18
  10. 关于Hibernate的部分知识总结