## 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) Provided C++ solution with detailed line-by-line comments

```cpp
#include <bits/stdc++.h>
using namespace std;

// Print a std::pair as "first second"
template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

// Read a std::pair from input
template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

// Read a vector by reading each element in order
template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) in >> x;
    return in;
};

// Print a vector elements separated by spaces (unused in this task)
template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) out << x << ' ';
    return out;
};

using coord_t = double;

// 2D point / vector geometry helper
struct Point {
    static constexpr coord_t eps = 1e-9;               // numeric epsilon
    static inline const coord_t PI = acos((coord_t)-1.0); // pi

    coord_t x, y;

    // Constructor with default (0,0)
    Point(coord_t x = 0, coord_t y = 0) : x(x), y(y) {}

    // Vector addition
    Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); }
    // Vector subtraction
    Point operator-(const Point& p) const { return Point(x - p.x, y - p.y); }
    // Scalar multiplication
    Point operator*(coord_t c) const { return Point(x * c, y * c); }
    // Scalar division
    Point operator/(coord_t c) const { return Point(x / c, y / c); }

    // Dot product
    coord_t operator*(const Point& p) const { return x * p.x + y * p.y; }
    // Cross product (2D scalar cross)
    coord_t operator^(const Point& p) const { return x * p.y - y * p.x; }

    // Comparison operators (mostly unused here)
    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; }

    // Squared length
    coord_t norm2() const { return x * x + y * y; }
    // Length
    coord_t norm() const { return sqrt(norm2()); }
    // Angle of the vector w.r.t x-axis
    coord_t angle() const { return atan2(y, x); }

    // Rotate this point/vector around origin by angle a (radians, CCW)
    Point rotate(coord_t a) const {
        return Point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
    }

    // Perpendicular vector (rotated +90 degrees)
    Point perp() const { return Point(-y, x); }

    // Unit vector in same direction
    Point unit() const { return *this / norm(); }

    // Unit normal (perp then unit)
    Point normal() const { return perp().unit(); }

    // Project p onto this vector (treating *this as a direction)
    Point project(const Point& p) const {
        return *this * (*this * p) / norm2();
    }

    // Reflect p across the line through origin with direction *this
    Point reflect(const Point& p) const {
        return *this * 2 * (*this * p) / norm2() - p;
    }

    // Output formatting: "x y"
    friend ostream& operator<<(ostream& os, const Point& p) {
        return os << p.x << ' ' << p.y;
    }
    // Input formatting: read x y
    friend istream& operator>>(istream& is, Point& p) {
        return is >> p.x >> p.y;
    }

    // ccw test: sign of cross((b-a),(c-a))
    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; // collinear
        else if(v > 0) return 1;            // counterclockwise
        else return -1;                     // clockwise
    }

    // Check if p lies on segment [a,b] (unused)
    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;
    }

    // Check if p in triangle abc (unused)
    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);
    }

    // Intersection of infinite lines a1-b1 and a2-b2 (unused)
    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));
    }

    // Check if vectors a and b are collinear (unused)
    friend bool collinear(const Point& a, const Point& b) {
        return abs(a ^ b) < eps;
    }

    // Circumcenter of triangle abc (unused)
    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);
    }

    // Arc area helper (unused)
    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;
    }

    // Circle-circle intersection (unused)
    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};
    }

    // Ray-segment intersection (unused)
    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; // polygon size and the two known indices
Point A, B;    // coordinates of vertex n1 and n2

// Read input values
void read() {
    cin >> n >> n1 >> n2;
    cin >> A >> B;
}

void solve() {
    // Number of steps when moving clockwise from n1 to n2.
    // Using modulo n to wrap around.
    auto k = (n2 - n1 + n) % n;

    // Central angle between those vertices (in radians)
    auto theta = 2.0 * Point::PI * k / n;

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

    // Half the chord length |AB|/2
    auto half_len = (B - A).norm() / 2.0;

    // From chord formula: |AB| = 2 R sin(theta/2)
    auto R = half_len / sin(theta / 2.0);

    // Unit vector perpendicular to (A-B) (points to one side of chord)
    auto perp = (A - B).perp().unit();

    // Distance from midpoint to center along perpendicular bisector: R cos(theta/2)
    // Choose center as mid + perp * (R cos(theta/2))
    auto O = mid + perp * (R * cos(theta / 2.0));

    cout << fixed << setprecision(6);

    // Generate vertices 1..n.
    // Vertex i differs from vertex n1 by (i - n1) steps clockwise.
    // Clockwise rotation corresponds to negative angle in standard coordinates.
    for(int i = 1; i <= n; ++i) {
        auto angle = -2.0 * Point::PI * (i - n1) / n; // rotation angle
        auto pt = O + (A - O).rotate(angle);          // rotate radius vector and shift back
        cout << pt << '\n';
    }
}

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

    int T = 1; // single test case
    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.