题目链接:http://codeforces.com/problemset/problem/1173/B
思路参考:https://www.cnblogs.com/blowhail/p/10991237.html
AC代码:
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin >> n; m = n / 2 +1; cout << m << endl; for(int i = 1;i <= m;i++) { cout << 1 << " " << i << endl; } for(int i = 2;i <= n - m + 1;i++) { cout << i << " " << m << endl; } return 0; }