p244.ans1
======================
YES
0 1
-0.5 0
0.5 0

=================
p244.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 h_in, d_in, m_in;

void read() { cin >> h_in >> d_in >> m_in; }

void solve() {
    // We can translate and rotate the triangle, so we can always arrive to a
    // case where the height AH is parallel to Oy, and point A has a fixed
    // coordinate. Let's use A = (0, h). This means that B = (x_B, 0) and C =
    // (x_C, 0). We also know that H = (0, 0) and M = ((x_B + x_C) / 2, 0). For
    // the bisector, we can't directly get the x-coordinate, so we will
    // introduce x_D, and have D = (x_D, 0). We now have 3 variables, and 2
    // constraints given by the lengths of AD and AM. However, we also have the
    // angle-bisector theorem that says AC:AB = CD:DB, or that's one more
    // constraint. This system now has an equal number of constraints and
    // variables, so we can solve it directly. Reflect if necessary so that
    // x_M = sqrt(m^2 - h^2) >= x_D = sqrt(d^2 - h^2) >= 0 (D is always between
    // H and M), and parameterize B = (x_M - t, 0), C = (x_M + t, 0) with
    // t > 0. Then BD = t - (x_M - x_D) and DC = t + (x_M - x_D); squaring
    // AB:AC = BD:DC, the cross terms cancel and using x_M^2 + h^2 = m^2 the
    // relation collapses to t^2 = (x_M - x_D) * (h^2 + x_M * x_D) / x_D. A
    // real triangle therefore requires h <= d <= m, and the boundaries h = d
    // or d = m only fit the isoceles case h = d = m.

    if(h_in > d_in || d_in > m_in) {
        cout << "NO\n";
        return;
    }
    if(h_in == d_in || d_in == m_in) {
        if(h_in == d_in && d_in == m_in) {
            coord_t h = h_in;
            cout << "YES\n";
            cout << fixed << setprecision(8);
            cout << Point(0, h) << '\n';
            cout << Point(-h, 0) << '\n';
            cout << Point(h, 0) << '\n';
        } else {
            cout << "NO\n";
        }
        return;
    }

    coord_t h = h_in, d = d_in, m = m_in;
    coord_t xM = sqrt(m * m - h * h);
    coord_t xD = sqrt(d * d - h * h);
    coord_t t = sqrt((xM - xD) * (h * h + xM * xD) / xD);

    cout << "YES\n";
    cout << fixed << setprecision(8);
    cout << Point(0, h) << '\n';
    cout << Point(xM - t, 0) << '\n';
    cout << Point(xM + t, 0) << '\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;
}

=================
p244.in1
======================
1 1 1


=================
p244.ans2
======================
NO

=================
statement.txt
======================
244. Height, Bisector and Median
time limit per test: 0.25 sec.
memory limit per test: 4096 KB
input: standard
output: standard



There is a triangle ABC. You are given lengths of its height, bisector and median. Your task is to construct this triangle, i.e. to find such points A, B and C, that triangle ABC will have height AH, bisector AD and median AM with lengths equal to given. Of course, if there is one solution, then there is an infinite number of solutions, so you may find any of them.

Input
Three integer numbers will be at the first line of file: |AH|, |AD|, |AM|. All numbers are positive and not exceed 100.

Output
In the first line write "YES", if such triangle could be constructed, and "NO" otherwise. In case of positive answer write coordinates of points A, B and C on the 2-nd, 3-rd and 4-th lines respectively. Coordinates must be real numbers with not more than 8 digits after decimal point and must not exceed 108 by absolute value. Your triangle must have non-zero area and the lengths of its height AH, bisector AD and median AM must not differ from given more than 10-6.

Sample test(s)

Input
Test #1
1 1 1

Test #2
1 1 2

Output
Test #1
YES
0 1
-0.5 0
0.5 0

Test #2
NO
Author:	Vladimir Yakovlev
Resource:	Ural State University training
Date:	September, 2003

=================
p244.in2
======================
1 1 2


=================
