#include using namespace std; #include using namespace atcoder; using ll = long long; using vi = vector; using vvi = vector>; using pll = pair; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define repr(i, n) for (int i = (int)(n - 1); i >= 0; --i) void rotate(pll &z) { z.second = exchange(z.first, -z.second); } pll operator+(const pll &a, const pll &b) { return {a.first + b.first, a.second + b.second}; } pll operator-(const pll &a, const pll &b) { return {a.first - b.first, a.second - b.second}; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); vector q; for (int x = 1; x < 1000; x++) { for (int y = 1; y < x; y++) { if (gcd(x, y) == 1) q.emplace_back(x, y); } } sort(q.begin(), q.end(), [](auto a, auto b) { return a.second * b.first < a.first * b.second; }); int n = 1000000; // int n; // cin >> n; q.resize(n / 4); pll cur = pll(0, 0); vector ret; rep(k, 4) { rep(i, n / 4) { ret.push_back(cur); cur = cur + q[i]; } rep(i, n / 4) rotate(q[i]); } ll mx = 0, my = 0; for (auto [x, y] : ret) { mx = min(mx, x); my = min(my, y); } ll LM = 1000000000; cout << n << '\n'; for (auto [x, y] : ret) { cout << x - mx - LM << " " << y - my - LM << '\n'; } return 0; }