## 1) Concise, abridged problem statement

You are given a regular \(N\)-gon (islands of an archipelago) with vertices numbered clockwise from \(1\) to \(N\). The coordinates of vertex \(N_1\) are \((X_1,Y_1)\) and of vertex \(N_2\) are \((X_2,Y_2)\). Reconstruct and output the coordinates of **all** \(N\) vertices in numeric order (1..N), each on its own line, accurate to **6 digits after the decimal point**.

Constraints: \(3 \le N \le 150\), \(N_1 \ne N_2\). Coordinates’ absolute values \(\le 10^6\).

---

## 2) Detailed editorial (how the solution works)

Let the known vertices be:
- \(A\) = vertex \(N_1\)
- \(B\) = vertex \(N_2\)

Because the polygon is regular, all vertices lie on a common circumcircle with center \(O\) and radius \(R\). The key is: if we can find \(O\), then every vertex is obtained by rotating a radius vector by multiples of \(2\pi/N\).

### Step A — Determine the central angle \(\angle AOB\)

Vertices are numbered clockwise. Let
\[
k = (N_2 - N_1 + N) \bmod N
\]
This is the number of steps when moving clockwise from \(N_1\) to \(N_2\). Each step corresponds to a central angle \(2\pi/N\), so:
\[
\theta = \angle AOB = \frac{2\pi k}{N}
\]

### Step B — Use chord geometry to find the circumradius \(R\)

Segment \(AB\) is a chord of the circumcircle. For a circle, chord length and central angle satisfy:
\[
|AB| = 2R\sin\left(\frac{\theta}{2}\right)
\]
So:
\[
R = \frac{|AB|/2}{\sin(\theta/2)}
\]

Let:
- \(M = (A+B)/2\) be the midpoint of chord \(AB\)
- \(d = |AB|/2\)

Then \(R = d / \sin(\theta/2)\).

### Step C — Locate the center \(O\)

The center \(O\) lies on the perpendicular bisector of chord \(AB\), i.e., along the line through \(M\) perpendicular to vector \((B-A)\).

In right triangle \(O M A\):
- \(OA = R\)
- \(MA = d\)
- \(OM = \sqrt{R^2 - d^2} = R\cos(\theta/2)\)

So we can compute:
\[
O = M + \hat{p} \cdot (R\cos(\theta/2))
\]
where \(\hat{p}\) is a unit vector perpendicular to \(AB\). There are two possible centers (on either side of chord), but the problem’s clockwise numbering fixes the orientation; the provided solution consistently chooses one side by using a specific perpendicular direction.

### Step D — Generate all vertices by rotation

We already know vertex \(N_1\) is at \(A\). Any other vertex \(i\) is obtained by rotating vector \((A-O)\) around \(O\) by the appropriate multiple of \(2\pi/N\).

Since numbering is **clockwise**, angles decrease in the usual mathematical convention (counterclockwise positive). So for vertex \(i\):
\[
\alpha_i = -\frac{2\pi}{N}(i - N_1)
\]
\[
P_i = O + \text{rotate}(A - O, \alpha_i)
\]

Output \(P_1, P_2, \dots, P_N\).

### Complexity

- All computations are constant time per vertex.
- Total time: \(O(N)\) (at most 150 points).
- Memory: \(O(1)\) besides the output.

---

## 3) C++ Solution

```cpp
#include <bits/stdc++.h>
// #include <coding_library/geometry/point.hpp>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

using coord_t = double;

struct Point {
    static constexpr coord_t eps = 1e-9;
    static inline const coord_t PI = acos((coord_t)-1.0);

    coord_t x, y;
    Point(coord_t x = 0, coord_t y = 0) : x(x), y(y) {}

    Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); }
    Point operator-(const Point& p) const { return Point(x - p.x, y - p.y); }
    Point operator*(coord_t c) const { return Point(x * c, y * c); }
    Point operator/(coord_t c) const { return Point(x / c, y / c); }

    coord_t operator*(const Point& p) const { return x * p.x + y * p.y; }
    coord_t operator^(const Point& p) const { return x * p.y - y * p.x; }

    bool operator==(const Point& p) const { return x == p.x && y == p.y; }
    bool operator!=(const Point& p) const { return x != p.x || y != p.y; }
    bool operator<(const Point& p) const {
        return x != p.x ? x < p.x : y < p.y;
    }
    bool operator>(const Point& p) const {
        return x != p.x ? x > p.x : y > p.y;
    }
    bool operator<=(const Point& p) const {
        return x != p.x ? x < p.x : y <= p.y;
    }
    bool operator>=(const Point& p) const {
        return x != p.x ? x > p.x : y >= p.y;
    }

    coord_t norm2() const { return x * x + y * y; }
    coord_t norm() const { return sqrt(norm2()); }
    coord_t angle() const { return atan2(y, x); }

    Point rotate(coord_t a) const {
        return Point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
    }

    Point perp() const { return Point(-y, x); }
    Point unit() const { return *this / norm(); }
    Point normal() const { return perp().unit(); }
    Point project(const Point& p) const {
        return *this * (*this * p) / norm2();
    }
    Point reflect(const Point& p) const {
        return *this * 2 * (*this * p) / norm2() - p;
    }

    friend ostream& operator<<(ostream& os, const Point& p) {
        return os << p.x << ' ' << p.y;
    }
    friend istream& operator>>(istream& is, Point& p) {
        return is >> p.x >> p.y;
    }

    friend int ccw(const Point& a, const Point& b, const Point& c) {
        coord_t v = (b - a) ^ (c - a);
        if(-eps <= v && v <= eps) {
            return 0;
        } else if(v > 0) {
            return 1;
        } else {
            return -1;
        }
    }

    friend bool point_on_segment(
        const Point& a, const Point& b, const Point& p
    ) {
        return ccw(a, b, p) == 0 && p.x >= min(a.x, b.x) - eps &&
               p.x <= max(a.x, b.x) + eps && p.y >= min(a.y, b.y) - eps &&
               p.y <= max(a.y, b.y) + eps;
    }

    friend bool point_in_triangle(
        const Point& a, const Point& b, const Point& c, const Point& p
    ) {
        int d1 = ccw(a, b, p);
        int d2 = ccw(b, c, p);
        int d3 = ccw(c, a, p);
        return (d1 >= 0 && d2 >= 0 && d3 >= 0) ||
               (d1 <= 0 && d2 <= 0 && d3 <= 0);
    }

    friend Point line_line_intersection(
        const Point& a1, const Point& b1, const Point& a2, const Point& b2
    ) {
        return a1 +
               (b1 - a1) * ((a2 - a1) ^ (b2 - a2)) / ((b1 - a1) ^ (b2 - a2));
    }

    friend bool collinear(const Point& a, const Point& b) {
        return abs(a ^ b) < eps;
    }

    friend Point circumcenter(const Point& a, const Point& b, const Point& c) {
        Point mid_ab = (a + b) / 2.0;
        Point mid_ac = (a + c) / 2.0;
        Point perp_ab = (b - a).perp();
        Point perp_ac = (c - a).perp();
        return line_line_intersection(
            mid_ab, mid_ab + perp_ab, mid_ac, mid_ac + perp_ac
        );
    }

    friend coord_t arc_area(
        const Point& center, coord_t r, const Point& p1, const Point& p2
    ) {
        coord_t theta1 = (p1 - center).angle();
        coord_t theta2 = (p2 - center).angle();
        if(theta2 < theta1 - eps) {
            theta2 += 2 * PI;
        }

        coord_t d_theta = theta2 - theta1;
        coord_t cx = center.x, cy = center.y;
        coord_t area = r * cx * (sin(theta2) - sin(theta1)) -
                       r * cy * (cos(theta2) - cos(theta1)) + r * r * d_theta;
        return area / 2.0;
    }

    friend vector<Point> intersect_circles(
        const Point& c1, coord_t r1, const Point& c2, coord_t r2
    ) {
        Point d = c2 - c1;
        coord_t dist = d.norm();

        if(dist > r1 + r2 + eps || dist < abs(r1 - r2) - eps || dist < eps) {
            return {};
        }

        coord_t a = (r1 * r1 - r2 * r2 + dist * dist) / (2 * dist);
        coord_t h_sq = r1 * r1 - a * a;
        if(h_sq < -eps) {
            return {};
        }
        if(h_sq < 0) {
            h_sq = 0;
        }
        coord_t h = sqrt(h_sq);

        Point mid = c1 + d.unit() * a;
        Point perp_dir = d.perp().unit();

        if(h < eps) {
            return {mid};
        }
        return {mid + perp_dir * h, mid - perp_dir * h};
    }

    friend optional<Point> intersect_ray_segment(
        const Point& ray_start, const Point& ray_through, const Point& seg_a,
        const Point& seg_b
    ) {
        Point ray_dir = ray_through - ray_start;
        if(ray_dir.norm2() < Point::eps) {
            return {};
        }
        Point seg_dir = seg_b - seg_a;
        coord_t denom = ray_dir ^ seg_dir;
        if(fabs(denom) < eps) {
            return {};
        }
        coord_t t = ((seg_a - ray_start) ^ seg_dir) / denom;
        if(t < eps) {
            return {};
        }
        coord_t s = ((seg_a - ray_start) ^ ray_dir) / denom;
        if(s < eps || s > 1 - eps) {
            return {};
        }
        return ray_start + ray_dir * t;
    }
};

int n, n1, n2;
Point A, B;

void read() {
    cin >> n >> n1 >> n2;
    cin >> A >> B;
}

void solve() {
    // This problem isn't fundamentally hard. We are given the two coordinates
    // of the n1-th and n2-th point, so if we look at the AB line, we know the
    // center O lies on the line perpendicular to AB that passes through the
    // midpoint of AB. We also know the number of points between n1 and n2, so
    // we can figure out the angle AOB, which should be enough to get us the
    // exact location of O. Afterwards, we are mostly done - we already have the
    // radius of the circumscribed circle around the n-gon (distance between A
    // and O), so we can just get the evenly spaced n points on the circle.

    auto k = (n2 - n1 + n) % n;
    auto theta = 2.0 * Point::PI * k / n;

    auto mid = (A + B) / 2.0;
    auto half_len = (B - A).norm() / 2.0;
    auto R = half_len / sin(theta / 2.0);
    auto perp = (A - B).perp().unit();
    auto O = mid + perp * (R * cos(theta / 2.0));

    cout << fixed << setprecision(6);
    for(int i = 1; i <= n; ++i) {
        auto angle = -2.0 * Point::PI * (i - n1) / n;
        auto pt = O + (A - O).rotate(angle);
        cout << pt << '\n';
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        solve();
    }

    return 0;
}
```

---

## 4) Python solution (same approach) with detailed comments

```python
import sys
import math

# --------- Basic 2D point utilities ---------

class Point:
    __slots__ = ("x", "y")
    def __init__(self, x=0.0, y=0.0):
        self.x = float(x)
        self.y = float(y)

    def __add__(self, other):
        return Point(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Point(self.x - other.x, self.y - other.y)

    def __mul__(self, k: float):
        # scalar multiplication
        return Point(self.x * k, self.y * k)

    def __truediv__(self, k: float):
        return Point(self.x / k, self.y / k)

    def norm(self) -> float:
        # Euclidean length
        return math.hypot(self.x, self.y)

    def perp(self):
        # rotate +90 degrees: (x,y) -> (-y,x)
        return Point(-self.y, self.x)

    def unit(self):
        # unit vector in same direction
        length = self.norm()
        return self / length

    def rotate(self, a: float):
        # rotate around origin by angle a (radians, CCW positive)
        ca = math.cos(a)
        sa = math.sin(a)
        return Point(self.x * ca - self.y * sa, self.x * sa + self.y * ca)


def main():
    data = sys.stdin.read().strip().split()
    if not data:
        return

    it = iter(data)

    # Read N, N1, N2
    n = int(next(it))
    n1 = int(next(it))
    n2 = int(next(it))

    # Read coordinates of vertex N1 and N2
    A = Point(float(next(it)), float(next(it)))
    B = Point(float(next(it)), float(next(it)))

    # k = number of clockwise steps from n1 to n2
    k = (n2 - n1 + n) % n

    # Central angle between A and B
    theta = 2.0 * math.pi * k / n

    # Midpoint of chord AB
    mid = (A + B) / 2.0

    # Half chord length
    half_len = (B - A).norm() / 2.0

    # Circumradius from chord-length formula
    R = half_len / math.sin(theta / 2.0)

    # Unit perpendicular direction to chord (choose a consistent side)
    perp = (A - B).perp().unit()

    # Center is offset from midpoint by R*cos(theta/2)
    O = mid + perp * (R * math.cos(theta / 2.0))

    # Output all vertices in order 1..N
    out_lines = []
    for i in range(1, n + 1):
        # Clockwise step corresponds to negative rotation angle
        angle = -2.0 * math.pi * (i - n1) / n
        pt = O + (A - O).rotate(angle)
        out_lines.append(f"{pt.x:.6f} {pt.y:.6f}")

    sys.stdout.write("\n".join(out_lines))

if __name__ == "__main__":
    main()
```

---

## 5) Compressed editorial

Compute \(k=(N_2-N_1+N)\bmod N\), so \(\theta=2\pi k/N\) is the central angle between known vertices \(A,B\). Let \(M=(A+B)/2\), \(d=|AB|/2\). From chord formula \(d=R\sin(\theta/2)\), get \(R=d/\sin(\theta/2)\). The center lies on the perpendicular bisector: \(OM=R\cos(\theta/2)\), so \(O=M+\hat{p}\,R\cos(\theta/2)\) where \(\hat{p}\) is a unit vector perpendicular to \(AB\) (choose a consistent orientation). Then vertex \(i\) is
\[
P_i = O + \text{rotate}(A-O,\,-2\pi(i-N_1)/N)
\]
Output \(P_1..P_N\) with 6 decimals.