{ set> li; REP(i, 1500) { const int vy = i + 1; REP(j, 1500) { const int vx = j + 1; int g = gcd(vy, vx); li.emplace(vy/g, vx/g); } } vector> li2(li.begin(), li.end()); sort(li2.begin(), li2.end(), [](pair l, pair r){ return (ll)(l.first)*r.second > (ll)(r.first)*l.second; } ); int n = 1000000; wt(n); n -= 2; ll y = 0, x = 0; ll oy = 0, ox = 0; // ll oy = 800000000, ox = 800000000; wt(0-oy, 0-ox); auto it = li2.begin(); REP(_, n) { y += it->first; x += it->second; wt(y-oy, x-ox); ++it; } wt(0-oy, x-ox); cout.flush(); }