Test instructions and Analysis
Graph theory Foundation + thinking problem.
Code
#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 (FAL SE); 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& lt;<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;}
Daily training "regular Bridge (codeforces Round 306 Div.2 D)