This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "nice_lines.h"
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using ldouble = long double;
using point = pair<lint, ldouble>;
const ldouble EPS = 1e-9;
const lint INF = 2.1e8;
const lint MAXV = 1e4;
const lint BASE = 2e4 + 1;
class Line {
 public:
  ldouble a, b;
  ldouble get(ldouble x) { return a * x + b; }
  Line(ldouble a, ldouble b) : a(a), b(b) {}
  Line(ldouble x1, ldouble y1, ldouble x2, ldouble y2) {
    a = (y1 - y2) / (x1 - x2);
    b = y1 - a * x1;
  }
};
void solve(int subtask_id, int N) {
  int query_count = 0;
  map<lint, ldouble> memo;
  const auto Query = [&](lint y) {
    if (memo.count(y)) return memo[y];
    query_count++;
    return memo[y] = query(BASE, ldouble(y) / 2);
  };
  const auto IntersectionX = [&](Line l1, Line l2) {
    // a1 * x + b1 = a2 * x + b2
    // x = (b2 - b1) / (a1 - a2)
    return (l2.b - l1.b) / (l1.a - l2.a);
  };
  const auto OneLine = [&](lint x_1, lint x_2, lint x_3) {
    if (x_1 == x_2 || x_1 == x_3 || x_2 == x_3) return true;
    ldouble y_1 = Query(x_1), y_2 = Query(x_2), y_3 = Query(x_3);
    return abs((y_2 - y_1) / (x_2 - x_1) - (y_3 - y_2) / (x_3 - x_2)) < EPS;
  };
  set<lint> changing_points;
  const auto Solve = [&](const auto &self, lint lft1, lint lft2, lint rgt1, lint rgt2) {
    Line lftLine(lft1, Query(lft1), lft2, Query(lft2));
    Line rgtLine(rgt1, Query(rgt1), rgt2, Query(rgt2));
    if (abs(lftLine.a - rgtLine.a) < EPS) return;
    lint midX = round(IntersectionX(lftLine, rgtLine));
    if (OneLine(lft1, lft2, midX) && OneLine(midX, rgt1, rgt2)) {
      changing_points.emplace(midX);
    } else {
      self(self, lft1, lft2, midX - 1, midX);
      self(self, midX - 1, midX, rgt1, rgt2);
    }
  };
  Solve(Solve, 2 * (-INF), 2 * (-INF + BASE), 2 * (+INF), 2 * (+INF + BASE));
  assert(changing_points.size() == N);
  vector<int> answerA, answerB;
  for (auto y : changing_points) {
    assert(y % 2 == 0); y /= 2;
    // y = ax + b
    // x = BASE
    // b = y % BASE
    lint b = y % BASE;
    while (b < -MAXV) b += BASE;
    while (b > +MAXV) b -= BASE;
    assert((y - b) % BASE == 0);
    lint a = (y - b) / BASE;
    assert(-MAXV <= a && a <= +MAXV);
    assert(-MAXV <= b && b <= +MAXV);
    answerA.emplace_back(int(a));
    answerB.emplace_back(int(b));
  }
  return the_lines_are(answerA, answerB);
}
Compilation message (stderr)
In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from nicelines.cpp:3:
nicelines.cpp: In function 'void solve(int, int)':
nicelines.cpp:63:33: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   63 |   assert(changing_points.size() == N);
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |