#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; namespace utils{ #define ALL(x) begin(x), end(x) #define RALL(x) rbegin(x), rend(x) ///----- aliases using ll = long long int; using ull = unsigned long long; template using p_queue = priority_queue, Compare>; template using min_queue = p_queue>; template using max_queue = p_queue>; template inline bool CHMIN(T& X, const T& A){ if(X > A) {X = A; return true;} return false; } template inline bool CHMAX(T& X, const T& A){ if(X < A) {X = A; return true;} return false; } ///----- vector I/O template vector VEC(size_t n, T t){ return vector(n, t); } template auto VEC(size_t n, Ts ... ts){ return vector(n, VEC(ts...)); } template istream& operator>>(istream& is, vector& v){ for (auto &&x : v) { is >> x; } return is; } template ostream& operator<<(ostream& os, const vector& v){ auto p = v.begin(); assert(p != v.end()); os << *p++; while(p != v.end()){ os << ' ' << *p++; } return os ; } template ostream& operator<<(ostream& os, const vector>& v){ auto p = v.begin(); assert(p != v.end()); os << *p++; while(p != v.end()){ os << '\n' << *p++; } return os; } ///----- tuple I/O template istream& operator>>(istream& is, tuple& t){ return is >> get<0>(t) >> get<1>(t); } template istream& operator>>(istream& is, pair& t){ return is >> get<0>(t) >> get<1>(t); } template istream& operator>>(istream& is, tuple& t){ return is >> get<0>(t) >> get<1>(t) >> get<2>(t); } template ostream& operator<<(ostream& os, const tuple& t){ return os << get<0>(t) << ' ' << get<1>(t); } template ostream& operator<<(ostream& os, const pair& t){ return os << get<0>(t) << ' ' << get<1>(t); } template ostream& operator<<(ostream& os, const tuple& t){ return os << get<0>(t) << ' ' << get<1>(t) << ' ' << get<2>(t); } ///----- constants constexpr ll INFLL = 1'000'000'000'000'000'020ll; constexpr ll INF = 1'000'000'009; constexpr double PI = 3.14'159'265'358'979'323'846; constexpr double EPS = 1e-12; } using namespace utils; class solver{ istream& is; ostream& os; public: solver(istream& I, ostream& O) :is(I), os(O) {} void run(); }; void solver::run(){ const int N = 30000; int i; vector> E; for (int i = 1; i < N; ++i) { E.emplace_back(i, i+1); } // end i int cN = N; for (i = 3; i < N/2; i+=3) { E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); } // end i i--; E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); i+=2; while(i <= N){ E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); E.emplace_back(i, ++cN); i+=3; } os << cN << endl; for (auto &&[a, b]: E) { os << a << ' ' << b << '\n'; } // end [a, b] } int main(int argc, char *argv[]) { cin.tie(nullptr); ios::sync_with_stdio(false); solver(cin, cout).run(); return 0; }