## 1) Concise abridged problem statement

Given three positive integers \(h=|AH|\), \(d=|AD|\), \(m=|AM|\) (all \(\le 100\)) for a triangle \(ABC\), construct any triangle such that:

- \(AH\) is the height from \(A\) to line \(BC\) with length \(h\),
- \(AD\) is the angle bisector from \(A\) to side \(BC\) with length \(d\),
- \(AM\) is the median from \(A\) to side \(BC\) with length \(m\).

Output “YES” and coordinates of \(A,B,C\) (reals, up to 8 decimals) if possible, otherwise output “NO”. The triangle must have non-zero area and match lengths within \(10^{-6}\).

---

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

### Key geometric normalization
We may translate and rotate the plane without changing distances. So we can enforce a convenient coordinate system:

- Put the foot of the height \(H\) at the origin: \(H=(0,0)\).
- Make the height \(AH\) vertical, with length \(h\), so:
  \[
  A=(0,h)
  \]
- Since \(H\) is the perpendicular projection of \(A\) onto line \(BC\), line \(BC\) becomes the \(x\)-axis (\(y=0\)). Thus:
  \[
  B=(x_B,0),\quad C=(x_C,0)
  \]

Let:
- \(D\) be where the angle bisector from \(A\) hits \(BC\), so \(D=(x_D,0)\).
- \(M\) be midpoint of \(BC\), so:
  \[
  M=\left(\frac{x_B+x_C}{2},0\right)=(x_M,0)
  \]

Now the given lengths become simple:

- \(AH=h\) is already satisfied by construction.
- Median length:
  \[
  AM^2 = x_M^2 + h^2 = m^2 \;\Rightarrow\; x_M=\sqrt{m^2-h^2}
  \]
- Bisector length:
  \[
  AD^2 = x_D^2 + h^2 = d^2 \;\Rightarrow\; x_D=\sqrt{d^2-h^2}
  \]

So we immediately need **real** \(x_M, x_D\), hence:
\[
m\ge h,\quad d\ge h
\]
Also, the solution expects the bisector point to lie between the endpoints in a “normal” configuration; the derived formula also enforces:
\[
h \le d \le m
\]
(consistent with the code’s feasibility check).

### Parameterizing \(B\) and \(C\)
We know the midpoint \(M\) is at \(x_M\). Let \(BC\) be symmetric around \(M\) by choosing:
\[
B=(x_M-t,0),\quad C=(x_M+t,0),\quad t>0
\]
This guarantees non-zero area as long as \(t>0\).

Then distances along \(BC\) from \(D\) are:
\[
DB = x_D-(x_M-t)=t-(x_M-x_D)
\]
\[
DC = (x_M+t)-x_D=t+(x_M-x_D)
\]

### Using the Angle Bisector Theorem
Angle bisector theorem in triangle \(ABC\):
\[
\frac{AB}{AC} = \frac{DB}{DC}
\]
Square both sides to avoid square roots.

Compute:
\[
AB^2=(x_M-t)^2+h^2,\quad AC^2=(x_M+t)^2+h^2
\]
Thus:
\[
\frac{AB^2}{AC^2}=\frac{(t-(x_M-x_D))^2}{(t+(x_M-x_D))^2}
\]

Let \(\Delta=x_M-x_D\ge 0\). Then after cross-multiplying and expanding, the \(t^3\) and \(t\) cross terms cancel nicely, and solving yields the closed form used in the code:
\[
t^2 = \frac{(x_M-x_D)\,(h^2+x_Mx_D)}{x_D}
\]
So:
\[
t = \sqrt{\frac{(x_M-x_D)\,(h^2+x_Mx_D)}{x_D}}
\]

This requires:
- \(x_D>0\) (otherwise division by 0), i.e. \(d>h\) for the generic case.
- \(x_M>x_D\) to make \(t>0\) (i.e. \(m>d\)).

### Boundary cases
- If \(h=d=m\): an isosceles triangle works:
  \[
  A=(0,h),\; B=(-h,0),\; C=(h,0)
  \]
  Then \(M=(0,0)\) so \(AM=h\). The bisector from apex of isosceles hits midpoint at \(H=M\), so \(AD=AH=h\).
- If \(h=d<m\) or \(h<d=m\): the formula degenerates and any valid triangle would collapse; the code outputs **NO** except for the exact all-equal case.

### Final construction
If feasible:
1. Compute \(x_M=\sqrt{m^2-h^2}\)
2. Compute \(x_D=\sqrt{d^2-h^2}\)
3. Compute \(t\) by the formula above
4. Output:
   - \(A=(0,h)\)
   - \(B=(x_M-t,0)\)
   - \(C=(x_M+t,0)\)

This satisfies the required height, median, and angle bisector lengths by construction and theorem.

Complexity is \(O(1)\).

---

## 3) Provided C++ solution with detailed comments

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

// Print a 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 pair
template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

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

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

using coord_t = double;

// A general 2D point structure with many geometry utilities.
// For this problem, we mainly use it as a container for x,y and printing.
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) {}

    // Vector addition/subtraction and scalar operations
    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); }

    // Dot product and cross product
    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; }

    // Comparisons (exact, because we mostly deal with constructed doubles)
    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 norm and norm (length)
    coord_t norm2() const { return x * x + y * y; }
    coord_t norm() const { return sqrt(norm2()); }
    coord_t angle() const { return atan2(y, x); }

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

    // Perpendicular vector and unit / normal vectors
    Point perp() const { return Point(-y, x); }
    Point unit() const { return *this / norm(); }
    Point normal() const { return perp().unit(); }

    // Project/reflect point p onto/over direction of this vector (not used here)
    Point project(const Point& p) const {
        return *this * (*this * p) / norm2();
    }
    Point reflect(const Point& p) const {
        return *this * 2 * (*this * p) / norm2() - p;
    }

    // Printing and reading points
    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;
    }

    // The remaining functions are generic geometry helpers (not needed by solve())
    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 h_in, d_in, m_in;

void read() {
    // Read given integer lengths: height, bisector, median
    cin >> h_in >> d_in >> m_in;
}

void solve() {
    // Coordinate normalization:
    // Put H = (0,0), make AH vertical of length h => A = (0,h).
    // Put BC on x-axis, so B=(xB,0), C=(xC,0).
    //
    // M is midpoint of BC: M=(xM,0) and AM = m => xM^2 + h^2 = m^2.
    // D is point on BC where bisector hits: D=(xD,0) and AD = d => xD^2 + h^2 = d^2.
    //
    // Then parametrize B and C symmetrically around M:
    // B=(xM-t,0), C=(xM+t,0), t>0.
    //
    // Angle bisector theorem AB/AC = BD/DC leads to:
    // t^2 = (xM - xD) * (h^2 + xM*xD) / xD.
    //
    // Valid triangle requires h <= d <= m, and boundary equality only works for h=d=m.

    // Basic feasibility: we need h <= d <= m
    if(h_in > d_in || d_in > m_in) {
        cout << "NO\n";
        return;
    }

    // Handle degenerate boundary cases explicitly
    if(h_in == d_in || d_in == m_in) {
        // Only possible when all three are equal (isosceles with bisector=height=median)
        if(h_in == d_in && d_in == m_in) {
            coord_t h = h_in;
            cout << "YES\n";
            cout << fixed << setprecision(8);
            // A at (0,h), B and C symmetric at (-h,0) and (h,0)
            cout << Point(0, h) << '\n';
            cout << Point(-h, 0) << '\n';
            cout << Point(h, 0) << '\n';
        } else {
            cout << "NO\n";
        }
        return;
    }

    // General case: h < d < m
    coord_t h = h_in, d = d_in, m = m_in;

    // From AM^2 = xM^2 + h^2
    coord_t xM = sqrt(m * m - h * h);

    // From AD^2 = xD^2 + h^2
    coord_t xD = sqrt(d * d - h * h);

    // Solve for half-base parameter t using derived formula
    coord_t t = sqrt((xM - xD) * (h * h + xM * xD) / xD);

    // Output constructed triangle
    cout << "YES\n";
    cout << fixed << setprecision(8);
    cout << Point(0, h) << '\n';          // A
    cout << Point(xM - t, 0) << '\n';      // B
    cout << Point(xM + t, 0) << '\n';      // C
}

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

    int T = 1;        // single test in this problem
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        solve();
    }
    return 0;
}
```

---

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

```python
import math
import sys

def solve():
    # Read h (height), d (bisector), m (median)
    data = sys.stdin.read().strip().split()
    h_in, d_in, m_in = map(int, data)

    # Feasibility condition for this construction:
    # Need h <= d <= m, otherwise xD or xM are not consistent with the geometry.
    if h_in > d_in or d_in > m_in:
        print("NO")
        return

    # Boundary cases:
    # If d == h or m == d, the general formula divides by xD or yields t=0.
    # The only valid non-degenerate case here is h == d == m (isosceles).
    if h_in == d_in or d_in == m_in:
        if h_in == d_in == m_in:
            h = float(h_in)
            print("YES")
            # A at (0,h), B and C at (-h,0),(h,0)
            print(f"{0:.8f} {h:.8f}")
            print(f"{-h:.8f} {0:.8f}")
            print(f"{h:.8f} {0:.8f}")
        else:
            print("NO")
        return

    # General case h < d < m
    h = float(h_in)
    d = float(d_in)
    m = float(m_in)

    # Put A=(0,h), BC on x-axis, H=(0,0).
    # From AM^2 = xM^2 + h^2 => xM = sqrt(m^2 - h^2)
    xM = math.sqrt(m*m - h*h)

    # From AD^2 = xD^2 + h^2 => xD = sqrt(d^2 - h^2)
    xD = math.sqrt(d*d - h*h)

    # Derived from angle bisector theorem under symmetric parametrization:
    # t^2 = (xM - xD) * (h^2 + xM*xD) / xD
    t2 = (xM - xD) * (h*h + xM*xD) / xD
    # Due to floating error, clamp very small negatives to zero
    if t2 < 0 and t2 > -1e-12:
        t2 = 0.0
    if t2 <= 0:
        # Would mean degenerate triangle (area 0) or impossible
        print("NO")
        return
    t = math.sqrt(t2)

    # Construct points
    Ax, Ay = 0.0, h
    Bx, By = xM - t, 0.0
    Cx, Cy = xM + t, 0.0

    print("YES")
    print(f"{Ax:.8f} {Ay:.8f}")
    print(f"{Bx:.8f} {By:.8f}")
    print(f"{Cx:.8f} {Cy:.8f}")

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

---

## 5) Compressed editorial

Normalize coordinates: set \(H=(0,0)\), make height vertical, so \(A=(0,h)\) and \(BC\) is the \(x\)-axis. Then \(M=(x_M,0)\) with \(x_M=\sqrt{m^2-h^2}\), and \(D=(x_D,0)\) with \(x_D=\sqrt{d^2-h^2}\). Parameterize \(B=(x_M-t,0)\), \(C=(x_M+t,0)\), \(t>0\). Apply angle bisector theorem \(AB/AC=BD/DC\) to get
\[
t^2=\frac{(x_M-x_D)(h^2+x_Mx_D)}{x_D}.
\]
Feasible only if \(h\le d\le m\); boundary equalities work only for \(h=d=m\) (use \(B=(-h,0),C=(h,0)\)). Output constructed points with 8 decimals.