Problem:
Problem G:
Malfatti Circles
The configuration of three circles packed inside a triangle such that each circle is tangent to the
other two circles and to two of the edges of the triangle has been studied by many mathematicians
for more than two centuries. Existence and uniqueness of such circles for an arbitrary triangle
are easy to prove. Many methods of numerical calculation or geometric construction of such
circles from an arbitrarily given triangle have been discovered. Today, such circles are called the
Malfatti circles
.
Figure 7 illustrates an example. The Malfatti circles of the triangle with the vertices (20, 80),
(-40, -20) and (120, -20) are approximately
the circle with the center (24.281677, 45.219486) and the radius 21.565935,
the circle with the center (3.110950, 4.409005) and the radius 24.409005, and
the circle with the center (54.556724, 7.107493) and the radius 27.107493.
Figure 8 illustrates another example. The Malfatti circles of the triangle with the vertices
(20, -20), (120, -20) and (-40, 80) are approximately
the circle with the center (25.629089, −10.057956) and the radius 9.942044,
the circle with the center (53.225883, −0.849435) and the radius 19.150565, and
the circle with the center (19.701191, 19.203466) and the radius 19.913790.
Your mission is to write a program to calculate the radii of the Malfatti circles of the given
triangles.
Input
The input is a sequence of datasets. A dataset is a line containing six integers
x
1
,
y
1
,
x
2
,
y
2
,
x
3
and
y
3
in this order, separated by a space. The coordinates of the vertices of the given triangle
are (
x
1
,
y
1
), (
x
2
,
y
2
) and (
x
3
,
y
3
), respectively. You can assume that the vertices form a triangle
counterclockwise. You can also assume that the following two conditions hold.
All of the coordinate values are greater than −1000 and less than 1000.
None of the Malfatti circles of the triangle has a radius less than 0.1.
The end of the input is indicated by a line containing six zeros separated by a space.
Output
For each input dataset, three decimal fractions
r
1
,
r
2
and
r
3
should be printed in a line in this
order separated by a space. The radii of the Malfatti circles nearest to the vertices with the
coordinates (
x
1
,
y
1
), (
x
2
,
y
2
) and (
x
3
,
y
3
) should be
r
1
,
r
2
and
r
3
, respectively.
None of the output values may have an error greater than 0.0001. No extra character should
appear in the output.
Sample Input
20 80 -40 -20 120 -20
20 -20 120 -20 -40 80
0 0 1 0 0 1
0 0 999 1 -999 1
897 -916 847 -972 890 -925
999 999 -999 -998 -998 -999
-999 -999 999 -999 0 731
-999 -999 999 -464 -464 999
979 -436 -955 -337 157 -439
0 0 0 0 0 0
Output for the Sample Input
21.565935 24.409005 27.107493
9.942044 19.150565 19.913790
0.148847 0.207107 0.207107
0.125125 0.499750 0.499750
0.373458 0.383897 0.100456
0.706768 0.353509 0.353509
365.638023 365.638023 365.601038
378.524085 378.605339 378.605339
21.895803 22.052921 5.895714

Submitted solutions:

code_snippet: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
struct Point
{
	double x, y;
}Tri[10];
double length(Point p)
{
	return (sqrt(p.x * p.x + p.y * p.y));
}
double cross(Point a, Point b)
{
	return a.x * b.y - a.y * b.x;
}
Point dang[4];
double ldang[4];
Point operator -(const Point &a, const Point &b)
{
	Point t;
	t.x = a.x - b.x;
	t.y = a.y - b.y;
	return t;
}
double dcmp(double x)
{
	if (fabs(x) < 1e-9)
		return 0;
	return x < 0 ? -1 : 1;
}
Point operator +(const Point &a, const Point &v)
{
	Point t;
	t.x = a.x + v.x;
	t.y = a.y + v.y;
	return t;
}
void init()
{
	for (int i = 0; i < 3; i++)
		scanf("%lf%lf", &Tri[i].x, &Tri[i].y);
	bool flag = false;
	for (int i = 0; i < 3; i++)
		if (Tri[i].x != 0 || Tri[i].y != 0)
		{
			flag = true;
			break;
		}
	if (!flag)
		exit(0);
	Point v1, v2;
	v1.x = Tri[1].x - Tri[0].x;
	v1.y = Tri[1].y - Tri[0].y;
	v2.x = Tri[2].x - Tri[0].x;
	v2.y = Tri[2].y - Tri[0].y;
	double d = length(v1);
	v1.x /= d; v1.y /= d;
	d = length(v2);
	v2.x /= d; v2.y /= d;
	Point e;
	e.x = v1.x + v2.x; e.y = v1.y + v2.y;
	dang[0] = e;
	double L = 0.0; double R = 100000;
	while (R - L > 1e-10)
	{
		double mid = (L + R) / 2.0;
		Point v1,v2, v3;
		v1 = Tri[1] - Tri[2];
		v2 = Tri[0] - Tri[2];
		v3.x = dang[0].x * mid;
		v3.y = dang[0].y * mid;
		v3 = v3 + v2;
		if (dcmp(cross(v2, v1)) * dcmp(cross(v3, v1)) >= 0)
			L = mid;
		else R = mid;
	}
	ldang[0] = L;
	v1.x = Tri[2].x - Tri[1].x;
	v1.y = Tri[2].y - Tri[1].y;
	v2.x = Tri[0].x - Tri[1].x;
	v2.y = Tri[0].y - Tri[1].y;
	d = length(v1);
	v1.x /= d; v1.y /= d;
	d = length(v2);
	v2.x /= d; v2.y /= d;
	e.x = v1.x + v2.x; e.y = v1.y + v2.y;
	dang[1] = e;
	L = 0.0; R = 100000;
	while (R - L > 1e-10)
	{
		double mid = (L + R) / 2.0;
		Point v1,v2, v3;
		v1 = Tri[0] - Tri[2];
		v2 = Tri[1] - Tri[2];
		v3.x = dang[1].x * mid;
		v3.y = dang[1].y * mid;
		v3 = v3 + v2;
		if (dcmp(cross(v2, v1)) * dcmp(cross(v3, v1)) >= 0)
			L = mid;
		else R = mid;
	}
	ldang[1] = L;
	v1.x = Tri[1].x - Tri[2].x;
	v1.y = Tri[1].y - Tri[2].y;
	v2.x = Tri[0].x - Tri[2].x;
	v2.y = Tri[0].y - Tri[2].y;
	d = length(v1);
	v1.x /= d; v1.y /= d;
	d = length(v2);
	v2.x /= d; v2.y /= d;
	e.x = v1.x + v2.x; e.y = v1.y + v2.y;
	dang[2] = e;
	L = 0.0; R = 100000;
	while (R - L > 1e-10)
	{
		double mid = (L + R) / 2.0;
		Point v1,v2, v3;
		v1 = Tri[0] - Tri[1];
		v2 = Tri[2] - Tri[1];
		v3.x = dang[2].x * mid;
		v3.y = dang[2].y * mid;
		v3 = v3 + v2;
		if (dcmp(cross(v2, v1)) * dcmp(cross(v3, v1)) >= 0)
			L = mid;
		else R = mid;
	}
	ldang[2] = L;
}
Point operator *(const Point &a, double b)
{
	Point t = a;
	t.x *= b;
	t.y *= b;
	return t;
}
struct cir
{
	double r;
	Point p;
}C[10];
void solve()
{
	double L = 0.0; double R = ldang[0];
	while (R - L > 1e-10)
	{
		double mid = (L + R) / 2.0;
		C[0].p = dang[0] * mid;  //xiang dui 
		Point v1 = Tri[1] - Tri[0]; 
		C[0].r = fabs(C[0].p.x * v1.y - C[0].p.y * v1.x) / (length(v1));
		v1 = Tri[2] - Tri[1];
		C[0].p.x += Tri[0].x; //jue dui
		C[0].p.y += Tri[0].y;
		Point v2 = C[0].p - Tri[1];
		double d1 = fabs(cross(v2,v1)) / length(v1);
	   	if (d1 < C[0].r)
		{
			R = mid;
			continue;
		}	
		//////// 
		double l = 0.0; double r = ldang[1];
		while (r - l > 1e-10)
		{
			double mid = (l + r) / 2.0;
			C[1].p = dang[1] * mid;
			Point v1 = Tri[2] - Tri[1];
			C[1].r = fabs(C[1].p.x * v1.y - C[1].p.y * v1.x) / (length(v1));
			C[1].p.x += Tri[1].x;
			C[1].p.y += Tri[1].y;
			double d = length(C[1].p - C[0].p);
			v1 = Tri[2] - Tri[0];
			Point v2 = C[1].p - Tri[0];
			double d1 = fabs(cross(v1, v2))/length(v1);
			if (d1 < C[1].r)
			{
				r = mid;
				continue;
			}
			if (dcmp(d - C[0].r - C[1].r) == -1)
				r = mid;
			else
				l = mid;
		}
		//////////
		l = 0.0; r = ldang[2];
		while (r - l > 1e-10)
		{
			double mid = (l + r) / 2.0;
			C[2].p = dang[2] * mid;
			Point v1 = Tri[0] - Tri[2];
			C[2].r = fabs(C[2].p.x * v1.y - C[2].p.y * v1.x) / (length(v1));
			C[2].p.x += Tri[2].x;
			C[2].p.y += Tri[2].y;
			v1 = Tri[1] - Tri[0];
			Point v2 = C[2].p - Tri[0];
			double d1 = fabs(cross(v1, v2))/length(v1);
			if (d1 < C[2].r)
			{
				r = mid;
				continue;
			}
			double d = length(C[2].p - C[0].p);
			if (dcmp(d-C[0].r - C[2].r) == -1)
				r = mid;
			else
				l = mid;
		}
		//////////
		double d = length(C[2].p - C[1].p);
		if (dcmp(d-C[2].r-C[1].r) == -1)
			L = mid;
		else
			R = mid;
	}
	printf("%.6f %.6f %.6f\n", C[0].r ,C[1].r, C[2].r);
}
int main()
{
	while (1)
	{
		init();
		solve();
	}
	return 0;
}
accuracy: 1
time_ms: 140
memory_kb: 3368
final_rank: 2

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end())
#define SZ(v) (int)v.size()
#define MIN(v) *min_element(ALL(v))
#define MAX(v) *max_element(ALL(v))
#define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin())
#define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin())

using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
const int inf = 0x3fffffff;
const ll INF = 0x1fffffffffffffff;

template <typename T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T, typename U> T ceil(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U> T floor(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T> int popcnt(T x) {
    return __builtin_popcountll(x);
}
template <typename T> int topbit(T x) {
    return (x == 0 ? -1 : 63 - __builtin_clzll(x));
}
template <typename T> int lowbit(T x) {
    return (x == 0 ? -1 : __builtin_ctzll(x));
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "P(" << p.first << ", " << p.second << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#ifdef LOCAL
#define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__)
#else
#define show(...) true
#endif
template <typename T> void _show(int i, T name) {
    cerr << '\n';
}
template <typename T1, typename T2, typename... T3>
void _show(int i, const T1 &a, const T2 &b, const T3 &...c) {
    for (; a[i] != ',' && a[i] != '\0'; i++)
        cerr << a[i];
    cerr << ":" << b << " ";
    _show(i + 1, a, c...);
}

/**
 * @brief template
 */

using T = long double;
const T eps = 1e-8;
using Point = complex<T>;
using Poly = vector<Point>;
#define X real()
#define Y imag()
template <typename T> inline bool eq(const T &a, const T &b) {
    return fabs(a - b) < eps;
}
bool cmp(const Point &a, const Point &b) {
    auto sub = [&](Point a) {
        return (a.Y < 0 ? -1 : (a.Y == 0 && a.X >= 0 ? 0 : 1));
    };
    if (sub(a) != sub(b))
        return sub(a) < sub(b);
    return a.Y * b.X < a.X * b.Y;
}
struct Line {
    Point a, b, dir;
    Line() {}
    Line(Point _a, Point _b) : a(_a), b(_b), dir(b - a) {}
    Line(T A, T B, T C) {
        if (eq(A, (T).0)) {
            a = Point(0, C / B), b = Point(1 / C / B);
        } else if (eq(B, (T).0)) {
            a = Point(C / A, 0), b = Point(C / A, 1);
        } else {
            a = Point(0, C / B), b = Point(C / A, 0);
        }
    }
};
struct Segment : Line {
    Segment() {}
    Segment(Point _a, Point _b) : Line(_a, _b) {}
};
struct Circle {
    Point p;
    T r;
    Circle() {}
    Circle(Point _p, T _r) : p(_p), r(_r) {}
};

istream &operator>>(istream &is, Point &p) {
    T x, y;
    is >> x >> y;
    p = Point(x, y);
    return is;
}
ostream &operator<<(ostream &os, Point &p) {
    os << fixed << setprecision(12) << p.X << ' ' << p.Y;
    return os;
}
Point unit(const Point &a) {
    return a / abs(a);
}
T dot(const Point &a, const Point &b) {
    return a.X * b.X + a.Y * b.Y;
}
T cross(const Point &a, const Point &b) {
    return a.X * b.Y - a.Y * b.X;
}
Point rot(const Point &a, const T &theta) {
    return Point(cos(theta) * a.X - sin(theta) * a.Y,
                 sin(theta) * a.X + cos(theta) * a.Y);
}
Point rot90(const Point &a) {
    return Point(-a.Y, a.X);
}
T arg(const Point &a, const Point &b, const Point &c) {
    double ret = acos(dot(a - b, c - b) / abs(a - b) / abs(c - b));
    if (cross(a - b, c - b) < 0)
        ret = -ret;
    return ret;
}

Point Projection(const Line &l, const Point &p) {
    T t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}
Point Projection(const Segment &l, const Point &p) {
    T t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
    return l.a + (l.a - l.b) * t;
}
Point Reflection(const Line &l, const Point &p) {
    return p + (Projection(l, p) - p) * (T)2.;
}
int ccw(const Point &a, Point b, Point c) {
    b -= a;
    c -= a;
    if (cross(b, c) > eps)
        return 1; // ccw

    if (cross(b, c) < -eps)
        return -1; // cw

    if (dot(b, c) < 0)
        return 2; // c,a,b

    if (norm(b) < norm(c))
        return -2; // a,b,c

    return 0;      // a,c,b

}
bool isOrthogonal(const Line &a, const Line &b) {
    return eq(dot(a.b - a.a, b.b - b.a), (T).0);
}
bool isParallel(const Line &a, const Line &b) {
    return eq(cross(a.b - a.a, b.b - b.a), (T).0);
}
bool isIntersect(const Segment &a, const Segment &b) {
    return ccw(a.a, a.b, b.a) * ccw(a.a, a.b, b.b) <= 0 and
           ccw(b.a, b.b, a.a) * ccw(b.a, b.b, a.b) <= 0;
}
int isIntersect(const Circle &a, const Circle &b) {
    T d = abs(a.p - b.p);
    if (d > a.r + b.r + eps)
        return 4;
    if (eq(d, a.r + b.r))
        return 3;
    if (eq(d, abs(a.r - b.r)))
        return 1;
    if (d < abs(a.r - b.r) - eps)
        return 0;
    return 2;
}
T Dist(const Line &a, const Point &b) {
    Point c = Projection(a, b);
    return abs(c - b);
}
T Dist(const Segment &a, const Point &b) {
    if (dot(a.b - a.a, b - a.a) < eps)
        return abs(b - a.a);
    if (dot(a.a - a.b, b - a.b) < eps)
        return abs(b - a.b);
    return abs(cross(a.b - a.a, b - a.a)) / abs(a.b - a.a);
}
T Dist(const Segment &a, const Segment &b) {
    if (isIntersect(a, b))
        return (T).0;
    T res = min({Dist(a, b.a), Dist(a, b.b), Dist(b, a.a), Dist(b, a.b)});
    return res;
}
Point Intersection(const Line &a, const Line &b) {
    T d1 = cross(a.b - a.a, b.b - b.a);
    T d2 = cross(a.b - a.a, a.b - b.a);
    if (eq(d1, (T)0.) and eq(d2, (T)0.))
        return b.a;
    return b.a + (b.b - b.a) * (d2 / d1);
}
Poly Intersection(const Circle &a, const Line &b) {
    Poly res;
    T d = Dist(b, a.p);
    if (d > a.r + eps)
        return res;
    Point h = Projection(b, a.p);
    if (eq(d, a.r)) {
        res.push_back(h);
        return res;
    }
    Point e = unit(b.b - b.a);
    T ph = sqrt(a.r * a.r - d * d);
    res.push_back(h - e * ph);
    res.push_back(h + e * ph);
    return res;
}
Poly Intersection(const Circle &a, const Segment &b) {
    Line c(b.a, b.b);
    Poly sub = Intersection(a, c);
    double xmi = min(b.a.X, b.b.X), xma = max(b.a.X, b.b.X);
    double ymi = min(b.a.Y, b.b.Y), yma = max(b.a.Y, b.b.Y);
    Poly res;
    rep(i, 0, sub.size()) {
        if (xmi <= sub[i].X + eps and sub[i].X - eps <= xma and
            ymi <= sub[i].Y + eps and sub[i].Y - eps <= yma) {
            res.push_back(sub[i]);
        }
    }
    return res;
}
Poly Intersection(const Circle &a, const Circle &b) {
    Poly res;
    int mode = isIntersect(a, b);
    T d = abs(a.p - b.p);
    if (mode == 4 or mode == 0)
        return res;
    if (mode == 3) {
        T t = a.r / (a.r + b.r);
        res.push_back(a.p + (b.p - a.p) * t);
        return res;
    }
    if (mode == 1) {
        if (b.r < a.r - eps) {
            res.push_back(a.p + (b.p - a.p) * (a.r / d));
        } else {
            res.push_back(b.p + (a.p - b.p) * (b.r / d));
        }
        return res;
    }
    T rc = (a.r * a.r + d * d - b.r * b.r) / d / (T)2.;
    T rs = sqrt(a.r * a.r - rc * rc);
    if (a.r - abs(rc) < eps)
        rs = 0;
    Point e = unit(b.p - a.p);
    res.push_back(a.p + rc * e + rs * e * Point(0, 1));
    res.push_back(a.p + rc * e + rs * e * Point(0, -1));
    return res;
}
Poly HalfplaneIntersection(vector<Line> &H) {
    sort(ALL(H), [&](Line &l1, Line &l2) { return cmp(l1.dir, l2.dir); });
    auto outside = [&](Line &L, Point p) -> bool {
        return cross(L.dir, p - L.a) < -eps;
    };
    deque<Line> deq;
    int sz = 0;
    rep(i, 0, SZ(H)) {
        while (sz > 1 and
               outside(H[i], Intersection(deq[sz - 1], deq[sz - 2]))) {
            deq.pop_back();
            sz--;
        }
        while (sz > 1 and outside(H[i], Intersection(deq[0], deq[1]))) {
            deq.pop_front();
            sz--;
        }
        if (sz > 0 and fabs(cross(H[i].dir, deq[sz - 1].dir)) < eps) {
            if (dot(H[i].dir, deq[sz - 1].dir) < 0) {
                return {};
            }
            if (outside(H[i], deq[sz - 1].a)) {
                deq.pop_back();
                sz--;
            } else
                continue;
        }
        deq.push_back(H[i]);
        sz++;
    }

    while (sz > 2 and outside(deq[0], Intersection(deq[sz - 1], deq[sz - 2]))) {
        deq.pop_back();
        sz--;
    }
    while (sz > 2 and outside(deq[sz - 1], Intersection(deq[0], deq[1]))) {
        deq.pop_front();
        sz--;
    }
    if (sz < 3)
        return {};
    deq.push_back(deq.front());
    Poly ret;
    rep(i, 0, sz) ret.push_back(Intersection(deq[i], deq[i + 1]));
    return ret;
}

T Area(const Poly &a) {
    T res = 0;
    int n = a.size();
    rep(i, 0, n) res += cross(a[i], a[(i + 1) % n]);
    return fabs(res / (T)2.);
}
T Area(const Poly &a, const Circle &b) {
    int n = a.size();
    if (n < 3)
        return (T).0;
    auto rec = [&](auto self, const Circle &c, const Point &p1,
                   const Point &p2) {
        Point va = c.p - p1, vb = c.p - p2;
        T f = cross(va, vb), res = (T).0;
        if (eq(f, (T).0))
            return res;
        if (max(abs(va), abs(vb)) < c.r + eps)
            return f;
        if (Dist(Segment(p1, p2), c.p) > c.r - eps)
            return c.r * c.r * arg(vb * conj(va));
        auto u = Intersection(c, Segment(p1, p2));
        Poly sub;
        sub.push_back(p1);
        for (auto &x : u)
            sub.push_back(x);
        sub.push_back(p2);
        rep(i, 0, sub.size() - 1) res += self(self, c, sub[i], sub[i + 1]);
        return res;
    };
    T res = (T).0;
    rep(i, 0, n) res += rec(rec, b, a[i], a[(i + 1) % n]);
    return fabs(res / (T)2.);
}
T Area(const Circle &a, const Circle &b) {
    T d = abs(a.p - b.p);
    if (d >= a.r + b.r - eps)
        return (T).0;
    if (d <= abs(a.r - b.r) + eps) {
        T r = min(a.r, b.r);
        return M_PI * r * r;
    }
    T ath = acos((a.r * a.r + d * d - b.r * b.r) / d / a.r / (T)2.);
    T res = a.r * a.r * (ath - sin(ath * 2) / (T)2.);
    T bth = acos((b.r * b.r + d * d - a.r * a.r) / d / b.r / (T)2.);
    res += b.r * b.r * (bth - sin(bth * 2) / (T)2.);
    return fabs(res);
}
bool isConvex(const Poly &a) {
    int n = a.size();
    int cur, pre, nxt;
    rep(i, 0, n) {
        pre = (i - 1 + n) % n;
        nxt = (i + 1) % n;
        cur = i;
        if (ccw(a[pre], a[cur], a[nxt]) == -1)
            return 0;
    }
    return 1;
}
int isContained(const Poly &a,
                const Point &b) { // 0:not contain,1:on edge,2:contain

    bool res = 0;
    int n = a.size();
    rep(i, 0, n) {
        Point p = a[i] - b, q = a[(i + 1) % n] - b;
        if (p.Y > q.Y)
            swap(p, q);
        if (p.Y < eps and eps < q.Y and cross(p, q) > eps)
            res ^= 1;
        if (eq(cross(p, q), (T).0) and dot(p, q) < eps)
            return 1;
    }
    return (res ? 2 : 0);
}
Poly ConvexHull(Poly &a) {
    sort(ALL(a), [](const Point &p, const Point &q) {
        return (eq(p.Y, q.Y) ? p.X < q.X : p.Y < q.Y);
    });
    a.erase(unique(ALL(a)), a.end());
    int n = a.size(), k = 0;
    Poly res(n * 2);
    for (int i = 0; i < n; res[k++] = a[i++]) {
        while (k >= 2 and
               cross(res[k - 1] - res[k - 2], a[i] - res[k - 1]) < eps)
            k--;
    }
    for (int i = n - 2, t = k + 1; i >= 0; res[k++] = a[i--]) {
        while (k >= t and
               cross(res[k - 1] - res[k - 2], a[i] - res[k - 1]) < eps)
            k--;
    }
    res.resize(k - 1);
    return res;
}
T Diam(const Poly &a) {
    int n = a.size();
    int x = 0, y = 0;
    rep(i, 1, n) {
        if (a[i].Y > a[x].Y)
            x = i;
        if (a[i].Y < a[y].Y)
            y = i;
    }
    T res = abs(a[x] - a[y]);
    int i = x, j = y;
    do {
        if (cross(a[(i + 1) % n] - a[i], a[(j + 1) % n] - a[j]) < 0)
            i = (i + 1) % n;
        else
            j = (j + 1) % n;
        chmax(res, abs(a[i] - a[j]));
    } while (i != x or j != y);
    return res;
}
Poly Cut(const Poly &a, const Line &l) {
    int n = a.size();
    Poly res;
    rep(i, 0, n) {
        Point p = a[i], q = a[(i + 1) % n];
        if (ccw(l.a, l.b, p) != -1)
            res.push_back(p);
        if (ccw(l.a, l.b, p) * ccw(l.a, l.b, q) < 0)
            res.push_back(Intersection(Line(p, q), l));
    }
    return res;
}

T Closest(Poly &a) {
    int n = a.size();
    if (n <= 1)
        return 0;
    sort(ALL(a), [&](Point a, Point b) {
        return (eq(a.X, b.X) ? a.Y < b.Y : a.X < b.X);
    });
    Poly buf(n);
    auto rec = [&](auto self, int lb, int rb) -> T {
        if (rb - lb <= 1)
            return (T)INF;
        int mid = (lb + rb) >> 1;
        auto x = a[mid].X;
        T res = min(self(self, lb, mid), self(self, mid, rb));
        inplace_merge(a.begin() + lb, a.begin() + mid, a.begin() + rb,
                      [&](auto p, auto q) { return p.Y < q.Y; });
        int ptr = 0;
        rep(i, lb, rb) {
            if (abs(a[i].X - x) >= res)
                continue;
            rep(j, 0, ptr) {
                auto sub = a[i] - buf[ptr - 1 - j];
                if (sub.Y >= res)
                    break;
                chmin(res, abs(sub));
            }
            buf[ptr++] = a[i];
        }
        return res;
    };
    return rec(rec, 0, n);
}

Circle Incircle(const Point &a, const Point &b, const Point &c) {
    T A = abs(b - c), B = abs(c - a), C = abs(a - b);
    Point p(A * a.X + B * b.X + C * c.X, A * a.Y + B * b.Y + C * c.Y);
    p /= (A + B + C);
    T r = Dist(Line(a, b), p);
    return Circle(p, r);
}
Circle Circumcircle(const Point &a, const Point &b, const Point &c) {
    Line l1((a + b) / (T)2., (a + b) / (T)2. + (b - a) * Point(0, 1));
    Line l2((b + c) / (T)2., (b + c) / (T)2. + (c - b) * Point(0, 1));
    Point p = Intersection(l1, l2);
    return Circle(p, abs(p - a));
}
Poly tangent(const Point &a, const Circle &b) {
    return Intersection(b, Circle(a, sqrt(norm(b.p - a) - b.r * b.r)));
}
vector<Line> tangent(const Circle &a, const Circle &b) {
    vector<Line> res;
    T d = abs(a.p - b.p);
    if (eq(d, (T)0.))
        return res;
    Point u = unit(b.p - a.p);
    Point v = u * Point(0, 1);
    for (int t : {-1, 1}) {
        T h = (a.r + b.r * t) / d;
        if (eq(h * h, (T)1.)) {
            res.push_back(Line(a.p + (h > 0 ? u : -u) * a.r,
                               a.p + (h > 0 ? u : -u) * a.r + v));
        } else if (1 > h * h) {
            Point U = u * h, V = v * sqrt(1 - h * h);
            res.push_back(Line(a.p + (U + V) * a.r, b.p - (U + V) * (b.r * t)));
            res.push_back(Line(a.p + (U - V) * a.r, b.p - (U - V) * (b.r * t)));
        }
    }
    return res;
}

/**
 * @brief Geometry
 */

int main() {
while(1) {
    long double x1, y1, x2, y2, x3, y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    if (x1 == 0.0L && y1 == 0.0L && x2 == 0.0L && y2 == 0.0L && x3 == 0.0L && y3 == 0.0L) return 0;
    Point A(x1,y1), B(x2,y2), C(x3,y3);
    Line a(B,C), b(C,A), c(A,B);
    Point I = (abs(B-C)*A+abs(C-A)*B+abs(A-B)*C)/(abs(B-C)+abs(C-A)+abs(A-B));
    long double IR = Dist(a,I);
    auto Judge = [&](long double D) -> pair<bool,pair<long double,long double>> {
        long double OK = 0.0L, NG = 1.0L;
        Point CA = A + (I-A) * D;
        long double RA = IR * D;
        rep(_,0,60) {
            long double MID = (OK + NG) / 2.0L;
            Point CB = B + (I-B) * MID;
            long double RB = IR * MID;
            if (abs(CA-CB) >= RA + RB) OK = MID;
            else NG = MID;
        }
        long double DB = OK;
        OK = 0.0L, NG = 1.0L;
        rep(_,0,60) {
            long double MID = (OK + NG) / 2.0L;
            Point CC = C + (I-C) * MID;
            long double RC = IR * MID;
            if (abs(CA-CC) >= RA + RC) OK = MID;
            else NG = MID;
        }
        long double DC = OK;
        {
            Point CB = B + (I-B) * DB, CC = C + (I-C) * DC;
            if (abs(CB-CC) >= IR * (DB+DC)) return {true,{DB,DC}};
            else return {false,{DB,DC}};
        }
    };
    {
        long double NG = 0.0L, OK = 1.0L;
        rep(_,0,60) {
            long double MID = (NG + OK) / 2.0L;
            if (Judge(MID).first) OK = MID;
            else NG = MID;
        }
        auto ANS = Judge(OK).second;
        printf("%.12Lf %.12Lf %.12Lf\n", IR*OK, IR*ANS.first, IR*ANS.second);
    }
}
}
accuracy: 1
time_ms: 630
memory_kb: 3580
final_rank: 13

code_snippet: #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;

class Vec2 {
   public:
	double x, y;

	Vec2()
		: x(0), y(0) {};

	Vec2(const double& x, const double& y)
		: x(x), y(y) {};

	double Mag() const {
		return sqrt(this->x * this->x + this->y * this->y);
	}

	Vec2 operator+(const Vec2& t) const {
		return Vec2{this->x + t.x, this->y + t.y};
	}

	Vec2 operator-(const Vec2& t) const {
		return Vec2{this->x - t.x, this->y - t.y};
	}

	Vec2 operator/(const double& t) const {
		return Vec2{this->x / t, this->y / t};
	}

	friend Vec2 operator*(const double& t, const Vec2 vec2) {
		return Vec2{t * vec2.x, t * vec2.y};
	}

	bool operator==(const Vec2 t) const {
		return (this->x == t.x and this->y == t.y);
	}
};

class Circle {
   public:
	Vec2 center;
	double radius;

	Circle()
		: center(Vec2{0.0, 0.0}), radius(0.0) {};

	Circle(const Vec2& center, const double& radius)
		: center(center), radius(radius) {};
};

Circle Incircle(const array<Vec2, 3>& vertices) {
	Circle incircle;

	double m12 = (vertices[1] - vertices[2]).Mag();
	double m20 = (vertices[2] - vertices[0]).Mag();
	double m01 = (vertices[0] - vertices[1]).Mag();
	incircle.center = (m12 * vertices[0] + m20 * vertices[1] + m01 * vertices[2]) / (m12 + m20 + m01);
	double s = (m12 + m20 + m01) / 2.0;
	incircle.radius = sqrt(s * (s - m12) * (s - m20) * (s - m01)) / s;

	return incircle;
}

Circle AnotherCircle(const Vec2& vertice, const Circle& incircle, const Vec2& v_to_i, const Circle& circle0) {
	Circle circle;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;

		circle = Circle{vertice + m * v_to_i, m * incircle.radius};

		if ((circle0.radius + circle.radius) > (circle0.center - circle.center).Mag()) r = m;
		else l = m;

		if ((r - l) * incircle.radius < threshold) break;
	}

	return circle;
}

bool solve() {
	array<Vec2, 3> vertices;
	for (Vec2& vertice : vertices) cin >> vertice.x >> vertice.y;
	if (vertices[0] == vertices[1]) return false;

	Circle incircle = Incircle(vertices);
	array<Vec2, 3> v_to_i{incircle.center - vertices[0], incircle.center - vertices[1], incircle.center - vertices[2]};
	array<Circle, 3> circles;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;

		circles[0] = Circle{vertices[0] + m * v_to_i[0], m * incircle.radius};
		circles[1] = AnotherCircle(vertices[1], incircle, v_to_i[1], circles[0]);
		circles[2] = AnotherCircle(vertices[2], incircle, v_to_i[2], circles[0]);

		if ((circles[1].radius + circles[2].radius) > (circles[1].center - circles[2].center).Mag()) l = m;
		else r = m;

		if ((r - l) * incircle.radius < threshold) break;
	}

	cout << fixed << setprecision(6);
	cout << circles[0].radius << " " << circles[1].radius << " " << circles[2].radius << endl;

	return true;
}

int main() {
	while (solve());
	return 0;
}
accuracy: 1
time_ms: 60
memory_kb: 3516
final_rank: 9

code_snippet: #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;

class Vec2 {
   public:
	double x, y;

	Vec2()
		: x(0), y(0) {};

	Vec2(const double& x, const double& y)
		: x(x), y(y) {};

	double Mag() const {
		return sqrt(this->x * this->x + this->y * this->y);
	}

	Vec2 operator+(const Vec2& t) const {
		return Vec2{this->x + t.x, this->y + t.y};
	}

	Vec2 operator-(const Vec2& t) const {
		return Vec2{this->x - t.x, this->y - t.y};
	}

	Vec2 operator/(const double& t) const {
		return Vec2{this->x / t, this->y / t};
	}

	friend Vec2 operator*(const double& t, const Vec2 vec2) {
		return Vec2{t * vec2.x, t * vec2.y};
	}

	bool operator==(const Vec2 t) const {
		return (this->x == t.x and this->y == t.y);
	}
};

class Circle {
   public:
	Vec2 center;
	double radius;

	Circle()
		: center(Vec2{0.0, 0.0}), radius(0.0) {};

	Circle(const Vec2& center, const double& radius)
		: center(center), radius(radius) {};
};

Circle Incircle(const array<Vec2, 3>& vertices) {
	Circle incircle;

	double m12 = (vertices[1] - vertices[2]).Mag();
	double m20 = (vertices[2] - vertices[0]).Mag();
	double m01 = (vertices[0] - vertices[1]).Mag();
	incircle.center = (m12 * vertices[0] + m20 * vertices[1] + m01 * vertices[2]) / (m12 + m20 + m01);
	double s = (m12 + m20 + m01) / 2.0;
	incircle.radius = sqrt(s * (s - m12) * (s - m20) * (s - m01)) / s;

	return incircle;
}

Circle AnotherCircle(const Vec2& vertice, const Circle& incircle, const Vec2& v_to_i, const Circle& circle0) {
	Circle circle;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;

		circle = Circle{vertice + m * v_to_i, m * incircle.radius};

		if ((circle0.radius + circle.radius) > (circle0.center - circle.center).Mag()) r = m;
		else l = m;

		if ((r - l) * incircle.radius < threshold) break;
	}

	return circle;
}

bool solve() {
	array<Vec2, 3> vertices;
	for (Vec2& vertice : vertices) cin >> vertice.x >> vertice.y;
	if (vertices[0] == vertices[1]) return false;

	Circle incircle = Incircle(vertices);
	array<Vec2, 3> v_to_i{incircle.center - vertices[0], incircle.center - vertices[1], incircle.center - vertices[2]};
	array<Circle, 3> circles;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;

		circles[0] = Circle{vertices[0] + m * v_to_i[0], m * incircle.radius};
		circles[1] = AnotherCircle(vertices[1], incircle, v_to_i[1], circles[0]);
		circles[2] = AnotherCircle(vertices[2], incircle, v_to_i[2], circles[0]);

		if ((circles[1].radius + circles[2].radius) > (circles[1].center - circles[2].center).Mag()) l = m;
		else r = m;
		if ((r - l) * incircle.radius < threshold) break;
	}

	cout << fixed << setprecision(6);
	cout << circles[0].radius << " " << circles[1].radius << " " << circles[2].radius << endl;

	return true;
}

int main() {
	while (solve());
	return 0;
}
accuracy: 1
time_ms: 60
memory_kb: 3392
final_rank: 3

code_snippet: #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;

class Vec2 {
   public:
	double x, y;

	Vec2()
		: x(0), y(0) {};

	Vec2(const double& x, const double& y)
		: x(x), y(y) {};

	double Mag() const {
		return sqrt(this->x * this->x + this->y * this->y);
	}

	Vec2 operator+(const Vec2& t) const {
		return Vec2{this->x + t.x, this->y + t.y};
	}

	Vec2 operator-(const Vec2& t) const {
		return Vec2{this->x - t.x, this->y - t.y};
	}

	Vec2 operator/(const double& t) const {
		return Vec2{this->x / t, this->y / t};
	}

	friend Vec2 operator*(const double& t, const Vec2 vec2) {
		return Vec2{t * vec2.x, t * vec2.y};
	}

	bool operator==(const Vec2 t) const {
		return (this->x == t.x and this->y == t.y);
	}
};

class Circle {
   public:
	Vec2 center;
	double radius;

	Circle()
		: center(Vec2{0.0, 0.0}), radius(0.0) {};

	Circle(const Vec2& center, const double& radius)
		: center(center), radius(radius) {};
};

Circle Incircle(const array<Vec2, 3>& vertices) {
	Circle incircle;

	double m12 = (vertices[1] - vertices[2]).Mag();
	double m20 = (vertices[2] - vertices[0]).Mag();
	double m01 = (vertices[0] - vertices[1]).Mag();
	incircle.center = (m12 * vertices[0] + m20 * vertices[1] + m01 * vertices[2]) / (m12 + m20 + m01);
	double s = (m12 + m20 + m01) / 2.0;
	incircle.radius = sqrt(s * (s - m12) * (s - m20) * (s - m01)) / s;

	return incircle;
}

Circle AnotherCircle(const Vec2& vertice, const Circle& incircle, const Vec2& v_to_i, const Circle& circle0) {
	Circle circle;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;
		circle = Circle{vertice + m * v_to_i, m * incircle.radius};

		double d = (circle0.radius + circle.radius) - (circle0.center - circle.center).Mag();
		// printf("l %10.6f  m %10.6f  r %10.6f  d %+10.6f\n", l, m, r, d);
		if ((r - l) * incircle.radius < threshold) break;
		else if (d > threshold) r = m;
		else if (d < -threshold) l = m;
		else break;
	}

	return circle;
}

bool solve() {
	array<Vec2, 3> vertices;
	for (Vec2& vertice : vertices) cin >> vertice.x >> vertice.y;
	if (vertices[0] == vertices[1]) return false;

	Circle incircle = Incircle(vertices);
	array<Vec2, 3> v_to_i{incircle.center - vertices[0], incircle.center - vertices[1], incircle.center - vertices[2]};
	array<Circle, 3> circles;

	double l{0.0}, r{1.0};
	const double threshold{0.0000001};
	while (true) {
		double m = (l + r) / 2.0;
		circles[0] = Circle{vertices[0] + m * v_to_i[0], m * incircle.radius};
		circles[1] = AnotherCircle(vertices[1], incircle, v_to_i[1], circles[0]);
		circles[2] = AnotherCircle(vertices[2], incircle, v_to_i[2], circles[0]);

		double d = (circles[1].radius + circles[2].radius) - (circles[1].center - circles[2].center).Mag();
		// printf("l %10.6f  m %10.6f  r %10.6f  d %+10.6f\n", l, m, r, d);
		if ((r - l) * incircle.radius < threshold) break;
		else if (d > threshold) l = m;
		else if (d < -threshold) r = m;
		else break;
	}

	cout << fixed << setprecision(6);
	cout << circles[0].radius << " " << circles[1].radius << " " << circles[2].radius << endl;

	return true;
}

int main() {
	while (solve());
	return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3464
final_rank: 7

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ld = long double;

const ld EPS = 1e-10;
const ld Pi = acos(-1);

using Point = complex<ld>;

//struct{
//    ld x, y;
//    Point() = default;
//    Point(ld a, ld b) : x(a), y(b) {}
//};

//iostream& operator>>(iostream& is, Point& P){
//    is >> P.x >> P.y;
//    return is;
//}

struct Circle{
    ld r;
    Point c;
    Circle() = default;
    Circle(ld a, Point b) : r(a), c(b) {}
};

ld cross(Point a, Point b){
    return real(a) * imag(b) - real(b) * imag(a);
}

Point rotate(Point o, Point p, ld theta){
    return (p - o) * Point(cos(theta), sin(theta)) + o;
}

ld findArg(Point a, Point o, Point b){
    return arg((b - o) / (a - o));
}

bool lineOver(Point p, Point a, Point b){
    return cross(a - p, b - p) < -EPS;
}

Point input(){
    ld x, y; cin >> x >> y;
    return Point(x, y);
}

int main(){
    cin.tie(nullptr); ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(6);

    auto solve = [&]() -> bool {
        Point A = input(), B = input(), C = input();
        if(norm(A) < EPS && norm(B) < EPS && norm(C) < EPS) return false;

        ld argBAC = findArg(B, A, C);
        ld argCBA = findArg(C, B, A);
        ld argACB = findArg(A, C, B);
        Point Asct = 0;
        {
            Point V = C - B;
            V /= abs(V);
            Asct = V * abs(C - B) * abs(B - A) / (abs(B - A) + abs(C - A)) + B;
        }
        Point Bsct = 0;
        {
            Point V = A - C;
            V /= abs(V);
            Bsct = V * abs(A - C) * abs(C - B) / (abs(C - B) + abs(A - B)) + C;
        }
        Point Va = rotate(0, B - A, argBAC / 2);
        Point Vb = rotate(0, C - B, argCBA / 2);
        Point Vc = rotate(0, A - C, argACB / 2);
        Va /= abs(Va);
        Vb /= abs(Vb);
        Vc /= abs(Vc);
        assert(abs(norm(Va)) < 1 + EPS);
        assert(abs(norm(Vb)) < 1 + EPS);
        assert(abs(norm(Vc)) < 1 + EPS);
        // cout << argBAC << " " << argCBA << " " << argACB << '\n';
        // cout << Va << " " << Vb << " " << Vc << endl;
        //cout << Bsct << '\n';
        ld Lta = 0, Rta = 1000000000;
        Circle P, Q, R;
        while(abs(Rta - Lta) > EPS){
            ld ta = (Rta + Lta) / 2;
            P.c = Va * ta + A;
            P.r = ta * sin(argBAC / 2);
            //cout << P.c << " " << P.r << '\n';
            if(lineOver(P.c, B, Bsct)){
                Rta = ta;
                continue;
            }

            // B
            {
                ld Ltb = 0, Rtb = 10000000000;
                while(abs(Rtb - Ltb) > EPS){
                    ld tb = (Rtb + Ltb) / 2;
                    Q.c = Vb * tb + B;
                    Q.r = tb * sin(argCBA / 2);
                    if(lineOver(Q.c, Asct, A)){
                        Rtb = tb;
                        continue;
                    }
                    if(Q.r + P.r > abs(Q.c - P.c)) Rtb = tb;
                    else Ltb = tb;
                }
            }

            // C
            {
                ld Ltc = 0, Rtc = 100000000;
                while(abs(Rtc - Ltc) > EPS){
                    ld tc = (Rtc + Ltc) / 2;
                    R.c = Vc * tc + C;
                    R.r = tc * sin(argACB / 2);
                    if(lineOver(R.c, A, Asct)){
                        Rtc = tc;
                        continue;
                    }
                    if(R.r + P.r > abs(R.c - P.c)) Rtc = tc;
                    else Ltc = tc;
                }
            }

            //cout << P.r << " " << Q.r << " " << R.r << '\n';
            //cout << P.c << " " << Q.c << " " << R.c << '\n';
            if(Q.r + R.r > abs(Q.c - R.c)) Lta = ta;
            else Rta = ta;
        }

        cout << P.r << " " << Q.r << " " << R.r << '\n';
        return true;
    };
    while(solve());
}
accuracy: 1
time_ms: 410
memory_kb: 3928
final_rank: 15

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i)
#define revrep(i, t, s) for (int i = (int)(t)-1; i >= (int)(s); --i)
#define all(x) begin(x), end(x)
template <typename T> bool chmax(T& a, const T& b) { return a < b ? (a = b, 1) : 0; }
template <typename T> bool chmin(T& a, const T& b) { return a > b ? (a = b, 1) : 0; }

using T = double;
using Vec = std::complex<T>;

const T PI = std::acos(-1);

constexpr T eps = 1e-12;
inline bool eq(T a, T b) { return std::abs(a - b) <= eps; }
inline bool eq(Vec a, Vec b) { return std::abs(a - b) <= eps; }
inline bool lt(T a, T b) { return a < b - eps; }
inline bool leq(T a, T b) { return a <= b + eps; }

std::istream& operator>>(std::istream& is, Vec& p) {
    T x, y;
    is >> x >> y;
    p = {x, y};
    return is;
}

struct Line {
    Vec p1, p2;
    Line() = default;
    Line(const Vec& p1, const Vec& p2) : p1(p1), p2(p2) {}
    Vec dir() const { return p2 - p1; }
};

struct Segment {
    Vec p1, p2;
    Segment() = default;
    Segment(const Vec& p1, const Vec& p2) : p1(p1), p2(p2) {}
    Vec dir() const { return p2 - p1; }
};

struct Circle {
    Vec c;
    T r;
    Circle() = default;
    Circle(const Vec& c, T r) : c(c), r(r) {}
};

using Polygon = std::vector<Vec>;

T dot(const Vec& a, const Vec& b) {
    return (std::conj(a) * b).real();
}

T cross(const Vec& a, const Vec& b) {
    return (std::conj(a) * b).imag();
}

Vec rot(const Vec& a, T ang) {
    return a * Vec(std::cos(ang), std::sin(ang));
}

Vec perp(const Vec& a) {
    return Vec(-a.imag(), a.real());
}

Vec projection(const Line& l, const Vec& p) {
    return l.p1 + dot(p - l.p1, l.dir()) * l.dir() / std::norm(l.dir());
}

Vec reflection(const Line& l, const Vec& p) {
    return T(2) * projection(l, p) - p;
}

// 0: collinear
// 1: counter-clockwise
// 2: clockwise
int ccw(const Vec& a, const Vec& b, const Vec& c) {
    if (eq(cross(b - a, c - a), 0)) return 0;
    if (lt(cross(b - a, c - a), 0)) return -1;
    return 1;
}

void sort_by_arg(std::vector<Vec>& pts) {
    std::sort(pts.begin(), pts.end(), [&](auto& p, auto& q) {
        if ((p.imag() < 0) != (q.imag() < 0)) return (p.imag() < 0);
        if (cross(p, q) == 0) {
            if (p == Vec(0, 0)) return !(q.imag() < 0 || (q.imag() == 0 && q.real() > 0));
            if (q == Vec(0, 0)) return  (p.imag() < 0 || (p.imag() == 0 && p.real() > 0));
            return (p.real() > q.real());
        }
        return (cross(p, q) > 0);
    });
}

T dist(const Line& l, const Vec& p) {
    return std::abs(cross(p - l.p1, l.dir())) / std::abs(l.dir());
}

// 0: inside
// 1: inscribe
// 2: intersect
// 3: circumscribe
// 4: outside
int intersect(const Circle& c1, const Circle& c2) {
    T d = std::abs(c1.c - c2.c);
    if (lt(d, std::abs(c2.r - c1.r))) return 0;
    if (eq(d, std::abs(c2.r - c1.r))) return 1;
    if (eq(c1.r + c2.r, d)) return 3;
    if (lt(c1.r + c2.r, d)) return 4;
    return 2;
}

Vec incenter(const Vec& A, const Vec& B, const Vec& C) {
    assert(ccw(A, B, C) != 0);
    T a = std::abs(B - C);
    T b = std::abs(C - A);
    T c = std::abs(A - B);
    return (a*A + b*B + c*C) / (a + b + c);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);

    while (true) {
        Vec a, b, c;
        cin >> a >> b >> c;
        if (eq(abs(a)+abs(b)+abs(c), 0)) break;
        Line ab(a, b), bc(b, c), ca(c, a);
        auto i = incenter(a, b, c);

        auto calc = [&](Vec& b, Vec& i, Line& bc, Circle& c1) {
            double lb = 0, ub = 1;
            rep(_,0,100) {
                double m = (lb + ub) / 2;
                auto x2 = b + (i - b) * m;
                double r2 = dist(bc, x2);

                Circle c2(x2, r2);

                if (intersect(c2, c1) == 4) lb = m;  // outside
                else ub = m;
            }
            auto x2 = b + (i - b) * ub;
            double r2 = dist(bc, x2);
            return Circle(x2, r2);
        };

        double lb = 0, ub = 1;
        rep(_,0,100) {
            double m = (lb + ub) / 2;
            auto x1 = a + (i - a) * m;
            double r1 = dist(ab, x1);
            Circle c1(x1, r1);

            auto c2 = calc(b, i, bc, c1);
            auto c3 = calc(c, i, bc, c1);
            if (intersect(c2, c3) == 4) ub = m;
            else lb = m;
        }

        auto x1 = a + (i - a) * ub;
        double r1 = dist(ab, x1);
        Circle c1(x1, r1);

        auto c2 = calc(b, i, bc, c1);
        auto c3 = calc(c, i, bc, c1);

        cout << c1.r << " " << c2.r << " " << c3.r << endl;
    }
}
accuracy: 1
time_ms: 1250
memory_kb: 3444
final_rank: 12

code_snippet: #line 1 "c.cpp"
/*	author:  Kite_kuma
	created: 2022.03.03 20:01:20 */

// #ifdef LOCAL
// #define _GLIBCXX_DEBUG
// #endif
#include <bits/stdc++.h>
using namespace std;

#pragma region macros

#define foa(s, v) for(auto &s : v)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcnt(n) __builtin_popcountll((long long)n)

#define REPname(a, b, c, d, e, ...) e
#define rep(...) REPname(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define REP0(x) for(int Counter_in_rep_macro = 0; Counter_in_rep_macro < (x); ++Counter_in_rep_macro)
#define REP1(i, x) for(int i = 0; i < (x); ++i)
#define REP2(i, l, r) for(int i = (l); i < (r); ++i)
#define REP3(i, l, r, c) for(int i = (l); i < (r); i += (c))

#define DREPname(a, b, c, d, e, ...) e
#define drep(...) DREPname(__VA_ARGS__, DREP3, DREP2, DREP1)(__VA_ARGS__)
#define DREP1(i, x) for(int i = (x)-1; i >= 0; --i)
#define DREP2(i, l, r) for(int i = (r)-1; i >= (l); --i)
#define DREP3(i, l, r, c) for(int i = (r)-1; i >= (l); i -= (c))

#pragma endregion

#pragma region aliases

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vvvi = std::vector<std::vector<std::vector<int>>>;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
template <class T = ll>
using V = std::vector<T>;
template <class T = ll>
using VV = V<V<T>>;
template <class T = ll>
using VVV = V<V<V<T>>>;
template <class T = ll>
using pqup = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T = ll>
using pqdn = std::priority_queue<T>;

#pragma endregion

#pragma region constants

const int inf = 1e9;
const long long INF = 1e18;
const long double pi = acos(-1);
const char dl = '\n';
const char sp = ' ';
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

const int mod_1000000007 = 1000000007;
const int mod_998244353 = 998244353;

#pragma endregion

#pragma region basic_operation

template <class T0, class T1, class T2>
inline bool in_range(T0 x, T1 lef, T2 rig) {
	return ((lef <= x) && (x < rig));
}

template <class T>
inline bool chmin(T &a, T b) {
	if(a > b) {
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b) {
	if(a < b) {
		a = b;
		return true;
	}
	return false;
}

void Yes(bool f = 1) { std::cout << (f ? "Yes" : "No") << '\n'; }
void No() { std::cout << "No\n"; }
void YES(bool f = 1) { std::cout << (f ? "YES" : "NO") << '\n'; }
void NO() { std::cout << "NO\n"; }

template <class T>
void drop(T answer) {
	std::cout << answer << '\n';
	exit(0);
}

void err(bool flag = true) {
	if(!flag) return;
	std::cout << -1 << '\n';
	exit(0);
}

template <class T>
void vout(std::vector<T> const &v, bool vertically = 0) {
	if(vertically) {
		for(auto const &a : v) {
			std::cout << a << '\n';
		}
		return;
	}
	for(auto it = v.begin(); it != v.end(); it++) {
		std::cout << (*it);
		if(it != v.end() - 1) {
			std::cout << ' ';
		}
	}
	std::cout << '\n';
	return;
}

inline void print() { std::cout << '\n'; }
template <class T>
inline void print(T x) {
	std::cout << x << '\n';
	return;
}
template <typename Head, typename... Tail>
void print(Head H, Tail... T) {
	std::cout << H << " ";
	print(T...);
}

template <class T>
void add(std::vector<T> &v, T val) {
	for(auto &a : v) a += val;
	return;
}

template <class T>
T dup(T a, T b) {
	assert(b != 0);
	return (a + b - 1) / b;
}

template <class T>
T greatest_lower_multiple(T x, T d) {
	if(d == 0) return 0;
	if(d < 0) d *= -1;
	T y = x % d;
	if(y < 0) y += d;
	return x - y;
}

template <class T>
T least_upper_multiple(T x, T d) {
	return -greatest_lower_multiple(-x, d);
}

long long POW(long long a, long long n) {
	long long res = 1;
	while(n > 0) {
		if(n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

long long modpow(long long a, long long n, long long mod) {	 // a^n mod
	assert(n >= 0 && mod);
	if(mod == 1) return 0LL;
	long long res = 1;
	a %= mod;
	while(n > 0) {
		if(n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res < 0 ? res + mod : res;
}

// return x which satisfies a * x % mod == gcd(a, mod)
// not (mod | a)
long long modinv(long long a, long long mod) {
	long long b = mod, u = 1, v = 0;
	while(b) {
		long long t = a / b;
		a -= t * b;
		std::swap(a, b);
		u -= t * v;
		std::swap(u, v);
	}
	u %= mod;
	if(u < 0) u += mod;
	return u;
}

template <class T>
int lb(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::lower_bound(a.begin(), a.end(), x));
}
template <class T>
int ub(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::upper_bound(a.begin(), a.end(), x));
}
template <class T>
void unq_sort(std::vector<T> &a) {
	std::sort(a.begin(), a.end());
	a.erase(std::unique(a.begin(), a.end()), a.end());
}
template <class T>
std::vector<int> press(std::vector<T> &a) {
	auto vec = a;
	unq_sort(vec);
	std::vector<int> ret;
	for(auto &v : a) ret.push_back(lb(vec, v));
	return ret;
}

#pragma endregion

#pragma region input
#define VEC(type, name, size) \
	vector<type> name(size);  \
	scanner::INPUT(name)
#define VVEC(type, name, h, w)                     \
	vector<vector<type>> name(h, vector<type>(w)); \
	scanner::INPUT(name)
#define INT(...)     \
	int __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LL(...)            \
	long long __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define STR(...)        \
	string __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define CHR(...)      \
	char __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define DBL(...)        \
	double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LD(...)              \
	long double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define TPL3(type0, type1, type2, name)   \
	std::tuple<type0, type1, type2> name; \
	scanner::INPUT(name);
#define TPL4(type0, type1, type2, type3, name)   \
	std::tuple<type0, type1, type2, type3> name; \
	scanner::INPUT(name);

namespace scanner {
template <class T>
void scan(T &a) {
	std::cin >> a;
}

template <class T, class L>
void scan(std::pair<T, L> &p) {
	scan(p.first);
	scan(p.second);
}

template <class T0, class T1, class T2>
void scan(std::tuple<T0, T1, T2> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	scan(t0);
	scan(t1);
	scan(t2);
	p = std::make_tuple(t0, t1, t2);
}

template <class T0, class T1, class T2, class T3>
void scan(std::tuple<T0, T1, T2, T3> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	T3 t3;
	scan(t0);
	scan(t1);
	scan(t2);
	scan(t3);
	p = std::make_tuple(t0, t1, t2, t3);
}

template <class T>
void scan(std::vector<T> &a) {
	for(auto &i : a) scan(i);
}

void INPUT() {}
template <class Head, class... Tail>
void INPUT(Head &head, Tail &... tail) {
	scan(head);
	INPUT(tail...);
}
}  // namespace scanner

template <typename T1, typename T2>
std::istream &operator>>(std::istream &is, std::pair<T1, T2> &p) {
	is >> p.first >> p.second;
	return is;
}
#pragma endregion

#pragma region debug

#pragma region output
template <typename T1, typename T2>
std::ostream &std::operator<<(std::ostream &os, const std::pair<T1, T2> &p) {
	os << p.first << " " << p.second;
	return os;
}
template <class T>
std::ostream &std::operator<<(std::ostream &os, const std::vector<T> &v) {
	for(int i = 0; i < (int)v.size(); i++) {
		if(i) os << " ";
		os << v[i];
	}
	return os;
}
#pragma endregion

#pragma region view

namespace viewer {
void view(const long long e) {
	if(e == INF)
		std::cerr << "INF";
	else if(e == -INF)
		std::cerr << "-INF";
	else
		std::cerr << e;
}

void view(const int e) {
	if(e == inf)
		std::cerr << "inf";
	else if(e == -inf)
		std::cerr << "-inf";
	else
		std::cerr << e;
}

template <typename T>
void view(const T e) {
	std::cerr << e;
}

template <typename T, typename U>
void view(const std::pair<T, U> &p) {
	std::cerr << "(";
	view(p.first);
	std::cerr << ", ";
	view(p.second);
	std::cerr << ")";
}

template <class T0, class T1, class T2>
void view(const std::tuple<T0, T1, T2> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ")";
}

template <class T0, class T1, class T2, class T3>
void view(const std::tuple<T0, T1, T2, T3> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ", ";
	view(std::get<3>(p));
	std::cerr << ")";
}

template <typename T>
void view(const std::set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::unordered_set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<T> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(const auto &e : v) {
		view(e);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<std::vector<T>> &vv) {
	std::cerr << "{\n";
	for(const auto &v : vv) {
		std::cerr << "\t";
		view(v);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::vector<std::pair<T, U>> &v) {
	std::cerr << "{\n";
	for(const auto &c : v) {
		std::cerr << "\t(";
		view(c.first);
		std::cerr << ", ";
		view(c.second);
		std::cerr << ")\n";
	}
	std::cerr << "}";
}

template <class T0, class T1, class T2>
void view(const std::vector<std::tuple<T0, T1, T2>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <class T0, class T1, class T2, class T3>
void view(const std::vector<std::tuple<T0, T1, T2, T3>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <typename T, typename U>
void view(const std::map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::unordered_map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}
}  // namespace viewer

#pragma endregion

// when debugging : g++ foo.cpp -DLOCAL
#ifdef LOCAL
void debug_out() {}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	viewer::view(H);
	std::cerr << ", ";
	debug_out(T...);
}
#define debug(...)                                                \
	do {                                                          \
		std::cerr << __LINE__ << " [" << #__VA_ARGS__ << "] : ["; \
		debug_out(__VA_ARGS__);                                   \
		std::cerr << "\b\b]\n";                                   \
	} while(0)
#define dump(x)                                      \
	do {                                             \
		std::cerr << __LINE__ << " " << #x << " : "; \
		viewer::view(x);                             \
		std::cerr << '\n';                           \
	} while(0)

#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

#pragma endregion
#line 8 "SPJ-Library/geometry/geometry.hpp"

#pragma region geometry

using Real = long double;
using R = Real;
using Point = std::complex<Real>;
using Vec = Point;
const Real EPS = 1e-10, PI = acos(-1);

inline bool eq(const Real &a, const Real &b) { return fabs(b - a) < EPS; }
inline bool eq(const Point &a, const Point &b) { return fabs(b - a) < EPS; }
/*
	-1: a < b
	0 : a == b
	1 : a > b
*/
inline int compare(const Real &a, const Real &b) { return eq(a, b) ? 0 : a < b ? -1 : 1; }

namespace std {
const Point operator*(const Point &p, const Real &d) { return Point(real(p) * d, imag(p) * d); }
}  // namespace std

std::istream &operator>>(std::istream &is, Point &p) {
	Real a, b;
	is >> a >> b;
	p = Point(a, b);
	return is;
}
std::ostream &operator<<(std::ostream &os, Point &p) { return os << std::fixed << std::setprecision(10) << p.real() << " " << p.imag(); }

// rotate point 'p' for counter clockwise direction
const Point rotate(const Real &theta, const Point &p) {
	return Point(cos(theta) * p.real() - sin(theta) * p.imag(), sin(theta) * p.real() + cos(theta) * p.imag());
}

const Real radian_to_degree(const Real &r) { return (r * 180.0 / PI); }

const Real degree_to_radian(const Real &d) { return (d * PI / 180.0); }

// get angle a-b-c (<pi)
const Real get_angle(const Point &a, const Point &b, const Point &c) {
	const Point v(a - b), w(c - b);
	Real theta = fabs(atan2(w.imag(), w.real()) - atan2(v.imag(), v.real()));
	return std::min(theta, 2 * PI - theta);
}

namespace std {
bool operator<(const Point &a, const Point &b) { return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag(); }
}  // namespace std

struct Line {
	Point a, b;

	Line() = default;

	Line(Point a, Point b) : a(a), b(b) {}

	Line(Real A, Real B, Real C)  // Ax + By = C
	{
		if(eq(A, 0))
			a = Point(0, C / B), b = Point(1, C / B);
		else if(eq(B, 0))
			b = Point(C / A, 0), b = Point(C / A, 1);
		else
			a = Point(0, C / B), b = Point(C / A, 0);
	}

	friend std::ostream &operator<<(std::ostream &os, Line &p) { return os << p.a << " -- " << p.b; }

	friend std::istream &operator>>(std::istream &is, Line &a) { return is >> a.a >> a.b; }
};

struct Segment : Line {
	Segment() = default;

	Segment(Point a, Point b) : Line(a, b) {}
};

struct Circle {
	Point p;
	Real r;

	Circle() = default;

	Circle(Point p, Real r) : p(p), r(r) {}
};

using Points = std::vector<Point>;
using Polygon = std::vector<Point>;
using Segments = std::vector<Segment>;
using Lines = std::vector<Line>;
using Circles = std::vector<Circle>;

const Real cross(const Point &a, const Point &b) { return real(a) * imag(b) - imag(a) * real(b); }
const Real dot(const Point &a, const Point &b) { return real(a) * real(b) + imag(a) * imag(b); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C
const int ccw(const Point &a, Point b, Point c) {
	b = b - a, c = c - a;
	if(cross(b, c) > EPS) return +1;		// "COUNTER_CLOCKWISE"
	if(cross(b, c) < -EPS) return -1;		// "CLOCKWISE"
	if(dot(b, c) < -EPS) return +2;			// "ONLINE_BACK"
	if(norm(b) + EPS < norm(c)) return -2;	// "ONLINE_FRONT"
	return 0;								// "ON_SEGMENT"
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
bool parallel(const Line &a, const Line &b) { return eq(cross(a.b - a.a, b.b - b.a), 0.0); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
bool orthogonal(const Line &a, const Line &b) { return eq(dot(a.a - a.b, b.a - b.b), 0.0); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_A
Point projection(const Line &l, const Point &p) {
	double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + (l.a - l.b) * t;
}

Point projection(const Segment &l, const Point &p) {
	double t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + (l.a - l.b) * t;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_B
Point reflection(const Line &l, const Point &p) { return projection(l, p) * 2.0 - p; }

int intersect(const Line &l, const Point &p) { return int(abs(ccw(l.a, l.b, p)) != 1); }

int intersect(const Line &l, const Line &m) {
	if(intersect(l, m.a) && intersect(l, m.b)) return -1;
	return int(abs(cross(l.b - l.a, m.b - m.a)) > EPS);
}

int intersect(const Segment &s, const Point &p) { return int(ccw(s.a, s.b, p) == 0); }

int intersect(const Line &l, const Segment &s) {
	if(intersect(l, s.a) && intersect(l, s.b)) return -1;
	return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < EPS;
}

Real distance(const Line &l, const Point &p);

int intersect(const Circle &c, const Line &l) {
	Real d = c.r - distance(l, c.p);
	return fabs(d) < EPS ? 1 : d > 0. ? 2 : 0;
}

int intersect(const Circle &c, const Point &p) { return int(abs(abs(p - c.p) - c.r) < EPS); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_B
int intersect(const Segment &s, const Segment &t) {
	if(eq(s.a, s.b)) return intersect(t, s.a);
	if(intersect(Line(s), t.a) && intersect(Line(s), t.b) &&
	   std::max(std::min(s.a, s.b), std::min(t.a, t.b)) < std::min(std::max(s.a, s.b), std::max(t.a, t.b)))
		return -1;
	return int(ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}

int intersect(const Circle &c, const Segment &l) {
	const Point h = projection(l, c.p);
	if(norm(h - c.p) - c.r * c.r > EPS) return 0;
	auto d1 = abs(c.p - l.a), d2 = abs(c.p - l.b);
	if(compare(d1, c.r) == -1 && compare(d2, c.r) == -1) return 0;
	if(d1 < c.r - EPS && d2 > c.r - EPS || d1 > c.r - EPS && d2 < c.r - EPS) return 1;
	return dot(l.a - h, l.b - h) < 0 ? 2 : 0;
}

Real distance(const Point &a, const Point &b);

int number_of_common_tangents(const Circle &c1, const Circle &c2) {
	Real r1 = std::min(c1.r, c2.r), r2 = std::max(c1.r, c2.r), d = distance(c1.p, c2.p);
	int com = compare(r1 + r2, d);
	return com == 1 ? compare(d + r1, r2) + 1 : 3 - com;
	// if(c1.r < c2.r) swap(c1, c2);
	// Real d = abs(c1.p - c2.p);
	// if(compare(c1.r + c2.r, d) == -1) return 4;
	// if(eq(c1.r + c2.r, d)) return 3;
	// if(compare(c1.r - c2.r, d) == -1) return 2;
	// return int(eq(c1.r - c2.r, d));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_A&lang=jp
int intersect(const Circle &c1, const Circle &c2) { return 2 - abs(2 - number_of_common_tangents(c1, c2)); }

Real distance(const Point &a, const Point &b) { return abs(a - b); }

Real distance(const Line &l, const Point &p) { return abs(p - projection(l, p)); }

Real distance(const Line &l, const Line &m) { return intersect(l, m) ? 0 : distance(l, m.a); }

Real distance(const Segment &s, const Point &p) {
	Point r = projection(s, p);
	return intersect(s, r) ? distance(r, p) : std::min(abs(s.a - p), abs(s.b - p));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
Real distance(const Segment &a, const Segment &b) {
	if(intersect(a, b)) return 0;
	return std::min({distance(a, b.a), distance(a, b.b), distance(b, a.a), distance(b, a.b)});
}

Real distance(const Line &l, const Segment &s) {
	if(intersect(l, s)) return 0;
	return std::min(distance(l, s.a), distance(l, s.b));
}

Point crosspoint(const Line &l, const Line &m) {
	Real A = cross(l.b - l.a, m.b - m.a);
	Real B = cross(l.b - l.a, l.b - m.a);
	if(eq(abs(A), 0.0) && eq(abs(B), 0.0)) return m.a;
	return m.a + (m.b - m.a) * B / A;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_C
Point crosspoint(const Segment &l, const Segment &m) { return crosspoint(Line(l), Line(m)); }

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_D
std::pair<Point, Point> crosspoint(const Circle &c, const Line l) {
	Point pr = projection(l, c.p);
	if(eq(distance(l, c.p), c.r)) return {pr, pr};
	Vec v = (l.b - l.a) / abs(l.b - l.a) * sqrt(c.r * c.r - norm(pr - c.p));
	return make_pair(pr - v, pr + v);
	// Vec e = (l.b - l.a) / abs(l.b - l.a);
	// double base = sqrt(c.r * c.r - norm(pr - c.p));
	// return {pr - e * base, pr + e * base};
}

std::pair<Point, Point> crosspoint(const Circle &c, const Segment &l) {
	if(intersect(c, l) == 2) return crosspoint(c, Line(l.a, l.b));
	auto ret = crosspoint(c, Line(l.a, l.b));
	if(dot(l.a - ret.first, l.b - ret.first) < EPS)
		ret.second = ret.first;
	else
		ret.first = ret.second;
	return ret;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_E
std::pair<Point, Point> crosspoint(const Circle &c1, const Circle &c2) {
	Real d = abs(c1.p - c2.p);
	Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));  // cosine theorem
	Real t = atan2(c2.p.imag() - c1.p.imag(), c2.p.real() - c1.p.real());
	Point p1 = c1.p + Point(cos(t + a) * c1.r, sin(t + a) * c1.r);
	Point p2 = c1.p + Point(cos(t - a) * c1.r, sin(t - a) * c1.r);
	return make_pair(p1, p2);
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_F
// "点 p を通る円 c の接線"の接点2つ
std::pair<Point, Point> tangent(const Circle &c1, const Point &p2) {
	return crosspoint(c1, Circle(p2, sqrt(norm(c1.p - p2) - c1.r * c1.r)));
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_G
// 円 c1, c2 の共通接線
Lines tangent(Circle c1, Circle c2) {
	Lines ret;
	if(c1.r < c2.r) std::swap(c1, c2);
	Real g = norm(c1.p - c2.p);
	if(eq(g, 0)) return ret;
	Vec u = (c2.p - c1.p) / Real(sqrt(g));
	Vec v = rotate(PI * 0.5, u);
	for(int s : {-1, 1}) {
		Real h = (c1.r + s * c2.r) / sqrt(g);
		if(eq(1 - h * h, 0)) {
			ret.emplace_back(c1.p + u * c1.r, c1.p + (u + v) * c1.r);
		} else if(1 - h * h > 0) {
			Point uu = u * h, vv = v * sqrt(1 - h * h);
			ret.emplace_back(c1.p + (uu + vv) * c1.r, c2.p - (uu + vv) * c2.r * s);
			ret.emplace_back(c1.p + (uu - vv) * c1.r, c2.p - (uu - vv) * c2.r * s);
		}
	}
	return ret;
}

// bisection of angle A-B-C
// https://onlinejudge.u-aizu.ac.jp/status/users/Kite_kuma/submissions/1/CGL_7_B/judge/5763316/C++17
Line bisection_of_angle(const Point &a, const Point &b, const Point &c) {
	Real da = distance(a, b);
	Real dc = distance(b, c);
	return Line(b, (a * dc + c * da) / (da + dc));
}

// https://onlinejudge.u-aizu.ac.jp/status/users/Kite_kuma/submissions/1/CGL_7_B/judge/5763316/C++17
Circle incircle_of_triangle(const Point &a, const Point &b, const Point &c) {
	Point center = crosspoint(bisection_of_angle(a, b, c), bisection_of_angle(b, c, a));
	return Circle(center, distance(Line(a, b), center));
}
Circle incircle_of_triangle(const Polygon &p) { return incircle_of_triangle(p[0], p[1], p[2]); }

#pragma endregion
#line 552 "c.cpp"

R radius_ub;
Point otherside(Polygon p, int idx) {
	rotate(p.begin(), p.begin() + idx, p.end());
	R beta = distance(p[1], p.front());
	R gamma = distance(p[2], p.front());
	return (p[1] * gamma + p[2] * beta) / (beta + gamma);
}

Circle cornercircle(Polygon p, int idx, R radius, Point leg) {
	rotate(p.begin(), p.begin() + idx, p.end());
	R ang = get_angle(p[1], p.front(), p.back());
	Vec unitvec = leg - p.front();
	unitvec /= fabs(unitvec);
	Point center = p.front() + unitvec * radius / sin(ang / 2);
	return Circle(center, radius);
}

R good_size(Polygon p, int idx, Circle c, Point leg) {
	R low = 0;
	R high = radius_ub;
	rep(30) {
		R mid = (low + high) / 2;
		Circle circ = cornercircle(p, idx, mid, leg);
		if(number_of_common_tangents(c, circ) == 4) {
			low = mid;
		} else
			high = mid;
	}
	return low;
}

vector<R> radius(Polygon p) {
	Points on_edge;
	rep(i, 3) on_edge.emplace_back(otherside(p, i));

	Circle inc = incircle_of_triangle(p);
	radius_ub = inc.r;

	auto is_large = [&](R r) -> bool {
		if(r > radius_ub) return true;
		Circle a = cornercircle(p, 0, r, on_edge.front());
		Circles cs;
		rep(idx, 1, 3) {
			R rad = good_size(p, idx, a, on_edge[idx]);
			cs.push_back(cornercircle(p, idx, rad, on_edge[idx]));
		}
		return number_of_common_tangents(cs.front(), cs.back()) == 4;
	};

	R low = 0;
	R high = radius_ub;
	rep(30) {
		R mid = (low + high) / 2;
		(is_large(mid) ? high : low) = mid;
	}

	V<R> rads;
	rads.push_back(low);
	Circle c = cornercircle(p, 0, rads.front(), on_edge.front());
	rep(idx, 1, 3) { rads.push_back(good_size(p, idx, c, on_edge[idx])); }
	return rads;
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout << std::fixed << std::setprecision(15);
	srand((unsigned)time(NULL));

	vector<int> vec(6);

	while(1) {
		ll sum = 0LL;
		foa(t, vec) {
			cin >> t;
			sum += t;
		}
		if(!sum) break;
		Polygon p;
		p.emplace_back(R(vec[0]), R(vec[1]));
		p.emplace_back(R(vec[2]), R(vec[3]));
		p.emplace_back(R(vec[4]), R(vec[5]));
		vector<R> ret = radius(p);
		vout(ret);
	}

	return 0;
}
accuracy: 1
time_ms: 1230
memory_kb: 3724
final_rank: 14

code_snippet: #include<bits/stdc++.h>

using namespace std;

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'

typedef long long ll;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;

typedef long double ld;
const ld DINF = 1e18;
const ld pi = acos(-1.0);
const ld eps = 1e-8;

#define sq(x) ((x)*(x))

bool eq(ld a, ld b) {
	return abs(a-b) <= eps;	
}

struct pt {
	ld x, y;
	pt(ld x_ = 0, ld y_ = 0) : x(x_), y(y_) {}
	
	pt operator + (const pt p) const { return pt(x+p.x, y + p.y); }
	pt operator - (const pt p) const { return pt(x-p.x, y - p.y); }
	pt operator * (const ld c) const { return pt(x*c, y*c); }
	pt operator / (const ld c) const { return pt(x/c, y/c); }
	ld operator * (const pt p) const { return x*p.x + y*p.y; }
	ld operator ^ (const pt p) const { return x*p.y - y*p.x; }
	friend istream& operator >> (istream& in, pt& p) {
		return in >> p.x >> p.y;	
	}
};

struct line {
	pt p, q;
	line() {}
	line (pt p_, pt q_) : p(p_), q(q_) {}
};

struct circ{
	pt c;
	ld r;
	circ() {}
	circ (pt c_, ld r_) : c(c_), r(r_) {}
};

ld dist(pt p, pt q) { // distancia
	return hypot(p.y - q.y, p.x - q.x);
}

ld norm(pt v) { // norma do vetor
 	return dist(pt(0, 0), v);
}

ld sarea(pt p, pt q, pt r) { // area com sinal
	return ((q-p)^(r-q))/2;
}

bool ccw(pt p, pt q, pt r) { // se p, q, r sao ccw
	return sarea(p, q, r) > eps;
}

pt rotate90(pt p) { // rotaciona 90 graus
	return pt(-p.y, p.x);
}

bool isinseg(pt p, line r) { // se p pertence ao seg de r
	pt a = r.p - p, b = r.q - p;
		return eq((a ^ b), 0) and (a * b) < eps;
}

bool interseg(line r, line s) { // se o seg de r intersecta o seg de s
	if (isinseg(r.p, s) or isinseg(r.q, s)
				or isinseg(s.p, r) or isinseg(s.q, r)) return 1;

					return ccw(r.p, r.q, s.p) != ccw(r.p, r.q, s.q) and
								ccw(s.p, s.q, r.p) != ccw(s.p, s.q, r.q);
}

ld disttoline(pt p, line r) { // distancia do ponto a reta
	return 2 * abs(sarea(p, r.p, r.q)) / dist(r.p, r.q);
}

bool circ_line_inter(pt a, pt b, circ C1) { // intersecao da circunf (c, r) e reta ab
	pt c = C1.c;
	ld r = C1.r;
	vector<pt> ret;
	b = b-a, a = a-c;
	ld A = b*b;
	ld B = a*b;
	ld C = a*a - r*r;
	ld D = B*B - A*C;
	if (D < -eps) return false;
	ret.push_back(c+a+b*(-B+sqrt(D+eps))/A);
	if (D > eps) ret.push_back(c+a+b*(-B-sqrt(D))/A);
	return true;
}

vector<pt> circ_inter(circ c1, circ c2) { // intersecao da circunf (a, r) e (b, R)
	pt a = c1.c, b = c2.c;
	ld r = c1.r, R = c2.r;
	vector<pt> ret;
	ld d = dist(a, b);
	if (d > r+R or d+min(r, R) < max(r, R)) return ret;
	ld x = (d*d-R*R+r*r)/(2*d);
	ld y = sqrt(r*r-x*x);
	pt v = (b-a)/d;
	ret.push_back(a+v*x + rotate90(v)*y);
	if (y > 0) ret.push_back(a+v*x - rotate90(v)*y);
	return ret;
}


// bissetriz no ponto a em relação e b e c
pt bisse(pt a, pt b, pt c) {
	pt p1 = b-a, p2 = c-a;
	p1 = p1 / norm(p1);
	p2 = p2 / norm(p2);
	pt bic = (p1+p2)/2;
	bic = bic / norm(bic);
	return bic;
}

circ solve(vector<pt> v, circ c) {
	pt bic = bisse(v[0], v[1], v[2]);
	ld l = 0.1, r = 1e4;
	circ C;
	while (abs(r-l) > eps) {
		ld m = (l+r) / 2;	
		pt c1 = v[0] + bic * m;
		ld r1 = disttoline(c1, line(v[0], v[1]));
		C = circ(c1, r1);
		if (interseg(line(v[1], v[2]), line(v[0], c1)) or 
			circ_line_inter(v[1], v[2], C)) {
			r = m;
			continue;
		}

		int sz = circ_inter(C, c).size();
		//cout << "second sz " << m << " "<< sz << endl;
		if (sz == 2) r = m;
		else if (sz == 0) l = m;
		else break;
	}
	return C;
}

int main() { _
	vector<pt> v(3);
	while (cin >> v[0] >> v[1] >> v[2]) {
		if (v[0].x == 0 and v[0].y == 0 and v[1].x == 0 and v[1].y == 0)
			break;

		pt bic = bisse(v[0], v[1], v[2]);
		ld l = 0.1, r = 1e4;

		circ C1, C2, C3;
		while (abs(r-l) > eps) {
			ld m = (l+r) / 2;	
			pt c1 = v[0] + bic * m;
			ld r1 = disttoline(c1, line(v[0], v[1]));
			C1 = circ(c1, r1);
			if (interseg(line(v[1], v[2]), line(v[0], c1)) or 
					circ_line_inter(v[1], v[2], C1)) {
				r = m;
				continue;
			}

			C1 = circ(c1, r1);
			rotate(v.begin(), v.begin()+1, v.end());
			C2 = solve(v, C1);
			rotate(v.begin(), v.begin()+1, v.end());
			C3 = solve(v, C1);
			rotate(v.begin(), v.begin()+1, v.end());

			int sz = circ_inter(C2, C3).size();
			//cout << m << " " << sz << endl;
			if (sz == 2) l = m;
			else if (sz == 0) r = m;
			else break;
		}
		cout << setprecision(6) << fixed;		
		cout << C1.r << " " << C2.r << " " << C3.r << endl;

	}

	exit(0);
}
accuracy: 1
time_ms: 1090
memory_kb: 3344
final_rank: 8

code_snippet: #include <bits/stdc++.h>
#define debug(x) cout << #x << " = " << x << endl
#define REP(i, n) for (Long i = 0; i < (Long)n; i++)
using namespace std;

typedef long long Long;
typedef long double Double;
const Double EPS = 1e-9;
const Double PI = acos(-1);

bool near(Double a, Double b) {
	return fabs(a - b) < EPS;
}

Double square(Double x) {
	return x * x;
}

int getSgn(Double x) {
	if (near(x, 0)) return 0;
	if (x > 0) return 1;
	return -1;
}

struct Point{
	Double x, y;
	Point(Double x = 0, Double y = 0): x(x), y(y) {}
	Point operator +(const Point &other) const {
		return Point(x + other.x, y + other.y);
	}
	Point operator -(const Point &other) const {
		return Point(x - other.x, y - other.y);
	}
	Point operator *(Double t) const {
		return Point(x * t, y * t);
	}
	Point operator /(Double t) const {
		assert(!near(t, 0));
		return Point(x / t, y / t);
	}
	Point operator +=(const Point &other) {
		*this = *this + other;
		return *this;
	}
	Point operator -=(const Point &other) {
		*this = *this - other;
		return *this;
	}
	Point operator *=(Double t) {
		*this = *this * t;
		return *this;
	}
	Point operator /=(Double t) {
		*this = *this / t;
		return *this;
	}
	bool operator ==(const Point &P) const {
		return near(x, P.x) && near(y, P.y);
	}
	Double abs2() {
		return x * x + y * y;
	}
	Double abs() {
		return sqrt(abs2());
	}
	Point ort() {
		return Point(-y, x);
	}
	Double cross(const Point &other) const {
		return x * other.y - y * other.x;
	}
	Double cross(const Point &A, const Point &B) const {
		//Given the current point P, this calculate PA x PB
		return (A - *this).cross(B - *this);
	}
};

typedef Point Vector;

//dot and cross products
Double dot(Point A, Point B) {
	return A.x * B.x + A.y * B.y;
}
Double cross(Point A, Point B) {
	return A.x * B.y - A.y * B.x;
}

//additional point operators with double
Point operator *(Double a, Point b) {
	return b * a;
}

Point operator /(Double a , Point b) {
	return b / a;
}

Double dist(Point A, Point B) {
	return sqrt(square(B.x - A.x) + square(B.y - A.y));
}

Vector bisect(Vector A, Vector B) {
	return A * B.abs() + B * A.abs();
}

istream & operator >> (istream &in, Point &A) {
	in >> A.x >> A.y;
	return in;
}

ostream & operator << (ostream &out, const Point &A) {
	out << A.x << " " << A.y;
	return out;
}

const int IT = 1e4;

pair<Double, Double> getRadious(Double r1, Double a, Double b, Double c, Double d1, Double d2) {
	Double disc2 = r1 - b * (a * r1 - d1);
	assert(disc2 >= -EPS);
	disc2 += EPS;
	Double r2 = (sqrt(disc2) - sqrt(r1)) / b;
	r2 *= r2;
	
	Double disc3 = r1 - c * (a * r1 - d2);
	assert(disc3 >= -EPS);
	disc3 += EPS;
	Double r3 = (sqrt(disc3) - sqrt(r1)) / c;
	r3 *= r3;
	assert(r2 >= -EPS);
	assert(r3 >= -EPS);
	return {r2, r3};
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(9);
	
	Long xA, yA, xB, yB, xC, yC;
	while (cin >> xA >> yA >> xB >> yB >> xC >> yC) {
		if (xA == 0 && yA == 0 && xB == 0 && yB == 0 && xC == 0 && yC == 0) {
			break;
		}
		Point A(xA, yA), B(xB, yB), C(xC, yC);
		Double a = dot(B - A, bisect(B - A, C - A)) / cross(B - A, bisect(B - A, C - A));
		Double b = dot(C - B, bisect(C - B, A - B)) / cross(C - B, bisect(C - B, A - B));
		Double c = dot(A - C, bisect(A - C, B - C)) / cross(A - C, bisect(A - C, B - C));
		assert(a >= -EPS);
		assert(b >= -EPS);
		assert(c >= -EPS);
		Double d1 = dist(A, B);
		Double d2 = dist(A, C);
		Double d3 = dist(B, C);
		//a * r1 + b * r2 + 2 * sqrt(r1 * r2) = d1
		//a * r1 + c * r3 + 2 * sqrt(r1 * r3) = d2
		//b * r2 + c * r3 + 2 * sqrt(r2 * r3) = d3
		Double low = 0.1;
		Double high = min({b * d1 / (a * b - 1), d1 / a , c * d2 / (a * c - 1), d2 / a});
		for (int i = 0; i < IT; i++) {
			Double r1 = (low + high) / 2;
			
			auto radii = getRadious(r1, a, b, c, d1, d2);
			Double r2 = radii.first;
			Double r3 = radii.second;
			
			Double val = b * r2 + c * r3 + 2 * sqrt(r2 * r3);
			if (val < d3) {
				high = r1;
			} else {
				low = r1;
			}
		}
		Double r1 = (low + high) / 2.0;
		auto radii = getRadious(r1, a, b, c, d1, d2);
		Double r2 = radii.first;
		Double r3 = radii.second;
		
		cout << r1 << " " << r2 << " " << r3 << "\n";
	}
	
	return 0;
}
accuracy: 1
time_ms: 780
memory_kb: 3344
final_rank: 5

code_snippet: #include <iostream>
#include <iomanip>

#include <algorithm>
#include <cassert>
#include <complex>
#include <iostream>
#include <optional>
#include <tuple>
#include <variant>
#include <vector>

namespace suisen {
namespace geometry {

    using coordinate_t = long double;
    using Point = std::complex<coordinate_t>;

    // operator

    Point operator+(const Point &p, coordinate_t real) { return Point(p) + Point(real, 0); }
    Point operator-(const Point &p, coordinate_t real) { return Point(p) - Point(real, 0); }
    Point operator*(const Point &p, coordinate_t real) { return Point(p) * Point(real, 0); }
    Point operator/(const Point &p, coordinate_t real) { return Point(p) / Point(real, 0); }
    Point operator+(coordinate_t real, const Point &p) { return Point(real, 0) + Point(p); }
    Point operator-(coordinate_t real, const Point &p) { return Point(real, 0) - Point(p); }
    Point operator*(coordinate_t real, const Point &p) { return Point(real, 0) * Point(p); }
    Point operator/(coordinate_t real, const Point &p) { return Point(real, 0) / Point(p); }

    std::istream& operator>>(std::istream &in, Point &p) {
        coordinate_t x, y;
        in >> x >> y;
        p = Point(x, y);
        return in;
    }
    std::ostream& operator<<(std::ostream &out, const Point &p) {
        return out << p.real() << ' ' << p.imag();
    }

    // relations between three points X, Y, Z.

    struct ISP {
        static constexpr int L_CURVE = +1; // +---------------+ Z is in 'a' => ISP = +1
        static constexpr int R_CURVE = -1; // |aaaaaaaaaaaaaaa| Z is in 'b' => ISP = -1
        static constexpr int FRONT   = +2; // |ddd X eee Y ccc| Z is in 'c' => ISP = +2
        static constexpr int BACK    = -2; // |bbbbbbbbbbbbbbb| Z is in 'd' => ISP = -2
        static constexpr int MIDDLE  =  0; // +---------------+ Z is in 'e' => ISP =  0
    };

    struct Sign {
        static constexpr int NEGATIVE = -1;
        static constexpr int ZERO = 0;
        static constexpr int POSITIVE = +1;
    };

    enum class Containment {
        OUT, ON, IN
    };

    constexpr Point ZERO = Point(0, 0);
    constexpr Point ONE  = Point(1, 0);
    constexpr Point I    = Point(0, 1);
    constexpr coordinate_t EPS = 1e-9;
    constexpr coordinate_t PI  = 3.14159265358979323846264338327950288419716939937510L;
    constexpr coordinate_t E   = 2.71828182845904523536028747135266249775724709369995L;

    constexpr auto XY_COMPARATOR = [](const Point &p, const Point &q) {
        return p.real() == q.real() ? p.imag() < q.imag() : p.real() < q.real();
    };
    constexpr auto XY_COMPARATOR_GREATER = [](const Point &p, const Point &q) {
        return p.real() == q.real() ? p.imag() > q.imag() : p.real() > q.real();
    };
    constexpr auto YX_COMPARATOR = [](const Point &p, const Point &q) {
        return p.imag() == q.imag() ? p.real() < q.real() : p.imag() < q.imag();
    };
    constexpr auto YX_COMPARATOR_GREATER = [](const Point &p, const Point &q) {
        return p.imag() == q.imag() ? p.real() > q.real() : p.imag() > q.imag();
    };

    int sgn(coordinate_t x) {
        return x > EPS ? Sign::POSITIVE : x < -EPS ? Sign::NEGATIVE : Sign::ZERO;
    }
    int compare(coordinate_t x, coordinate_t y) {
        return sgn(x - y);
    }

    auto cartesian(const coordinate_t real, const coordinate_t imag) {
        return Point(real, imag);
    }
    auto polar(const coordinate_t rho, const coordinate_t theta) {
        return Point(rho * std::cos(theta), rho * std::sin(theta));
    }
    auto cis(const coordinate_t theta) {
        return Point(std::cos(theta), std::sin(theta));
    }
    auto conj(const Point &z) {
        return Point(z.real(), -z.imag());
    }
    auto arg(const Point &z) {
        return std::atan2(z.imag(), z.real());
    }
    auto square_abs(const Point &z) {
        return z.real() * z.real() + z.imag() * z.imag();
    }
    auto abs(const Point &z) {
        return std::sqrt(square_abs(z));
    }
    auto rot(const Point &z, const coordinate_t theta) {
        return cis(theta) * z;
    }
    auto dot(const Point &a, const Point &b) {
        return a.real() * b.real() + a.imag() * b.imag();
    }
    auto det(const Point &a, const Point &b) {
        return a.real() * b.imag() - a.imag() * b.real();
    }
    bool equals(const Point &a, const Point &b) {
        return sgn(a.real() - b.real()) == Sign::ZERO and sgn(a.imag() - b.imag()) == Sign::ZERO;
    }
    bool equals(coordinate_t a, coordinate_t b) {
        return compare(a, b) == 0;
    }
    
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C
    int isp(const Point &a, const Point &b, const Point &c) {
        Point ab = b - a, ac = c - a;
        int s = sgn(det(ab, ac));
        if (s == Sign::POSITIVE) return ISP::L_CURVE;
        if (s == Sign::NEGATIVE) return ISP::R_CURVE;
        if (sgn(dot(ab, ac)) == Sign::NEGATIVE) return ISP::BACK;
        Point ba = a - b, bc = c - b;
        if (sgn(dot(ba, bc)) == Sign::NEGATIVE) return ISP::FRONT;
        return ISP::MIDDLE;
    }

    struct Line {
        Point a, b;
        Line() : Line(ZERO, ZERO) {}
        Line(const Point &from, const Point &to) : a(from), b(to) {}
    };
    struct Ray {
        Point a, b;
        Ray() : Ray(ZERO, ZERO) {}
        Ray(const Point &from, const Point &to) : a(from), b(to) {}
    };
    struct Segment {
        Point a, b;
        Segment() : Segment(ZERO, ZERO) {}
        Segment(const Point &from, const Point &to) : a(from), b(to) {}
    };
    struct Circle {
        Point center;
        coordinate_t radius;
        Circle() : Circle(ZERO, 0) {}
        Circle(const Point &c, const coordinate_t &r) : center(c), radius(r) {}
    };

    // Triangle
    
    coordinate_t signed_area(const Point &a, const Point &b, const Point &c) {
        return det(b - a, c - a) / 2;
    }
    coordinate_t area(const Point &a, const Point &b, const Point &c) {
        return std::abs(signed_area(a, b, c));
    }
    Point pG(const Point &a, const Point &b, const Point &c) {
        return (a + b + c) / 3;
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_B
    Circle pI(const Point &a, const Point &b, const Point &c) {
        auto la = std::abs(b - c), lb = std::abs(c - a), lc = std::abs(a - b);
        auto l = la + lb + lc;
        la /= l, lb /= l, lc /= l;
        Point center = la * a + lb * b + lc * c;
        auto radius = 2. * area(a, b, c) / l;
        return Circle(center, radius);
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_C
    Circle pO(const Point &a, const Point &b, const Point &c) {
        Point ab = b - a, bc = c - b, ca = a - c;
        auto la = square_abs(bc), lb = square_abs(ca), lc = square_abs(ab);
        auto s = la * (lb + lc - la), t = lb * (lc + la - lb), u = lc * (la + lb - lc);
        auto l = s + t + u;
        s /= l, t /= l, u /= l;
        Point center = a * s + b * t + c * u;
        return Circle(center, std::abs(center - a));
    }
    Point pH(const Point &a, const Point &b, const Point &c) {
        return a + b + c - 2 * pO(a, b, c).center;
    }
    auto pIabc(const Point &a, const Point &b, const Point &c) {
        return std::make_tuple(pI(-a, b, c), pI(a, -b, c), pI(a, b, -c));
    }

    // Line

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
    template <typename line_t_1, typename line_t_2>
    auto is_parallel(const line_t_1 &l1, const line_t_2 &l2) -> decltype(l1.a, l1.b, l2.a, l2.b, bool()) {
        return sgn(det(l1.b - l1.a, l2.b - l2.a)) == Sign::ZERO;
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_A
    template <typename line_t_1, typename line_t_2>
    auto is_orthogonal(const line_t_1 &l1, const line_t_2 &l2) -> decltype(l1.a, l1.b, l2.a, l2.b, bool())  {
        return sgn(dot(l1.b - l1.a, l2.b - l2.a)) == Sign::ZERO;
    }
    template <typename line_t_1, typename line_t_2>
    auto on_the_same_line(const line_t_1 &l1, const line_t_2 &l2) -> decltype(l1.a, l1.b, l2.a, l2.b, bool())  {
        return is_parallel(l1, l2) and sgn(det(l1.b - l1.a, l2.a - l1.a)) == Sign::ZERO;
    }

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_A
    template <typename line_t>
    Point projection(const Point &p, const line_t &line) {
        Point a = p - line.a;
        Point b = line.b - line.a;
        return line.a + dot(a, b) / square_abs(b) * b;
    }

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_B
    template <typename line_t>
    Point reflection(const Point &p, const line_t &line) {
        Point h = projection(p, line);
        return p + (h - p) * 2;
    }

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
    coordinate_t square_distance(const Point &p, const Segment &l) {
        Point h = projection(p, l);
        if (isp(l.a, l.b, h) == ISP::MIDDLE) {
            return square_abs(h - p);
        } else {
            return std::min(square_abs(p - l.a), square_abs(p - l.b));
        }
    }
    coordinate_t square_distance(const Segment &l, const Point &p) {
        return square_distance(p, l);
    }
    coordinate_t square_distance(const Point &p, const Ray &l) {
        Point h = projection(p, l);
        int dir = isp(l.a, l.b, h);
        return dir == ISP::MIDDLE or dir == ISP::FRONT ? square_abs(h - p) : std::min(square_abs(p - l.a), square_abs(p - l.b));
    }
    coordinate_t square_distance(const Ray &l, const Point &p) {
        return square_distance(p, l);
    }
    coordinate_t square_distance(const Point &p, const Line &l) {
        return square_abs(projection(p, l) - p);
    }
    coordinate_t square_distance(const Line &l, const Point &p) {
        return square_distance(p, l);
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
    coordinate_t distance(const Point &p, const Segment &l) {
        return std::sqrt(square_distance(p, l));
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
    coordinate_t distance(const Segment &l, const Point &p) {
        return distance(p, l);
    }
    coordinate_t distance(const Point &p, const Ray &l) {
        return std::sqrt(square_distance(p, l));
    }
    coordinate_t distance(const Ray &l, const Point &p) {
        return distance(p, l);
    }
    coordinate_t distance(const Point &p, const Line &l) {
        return std::sqrt(square_distance(p, l));
    }
    coordinate_t distance(const Line &l, const Point &p) {
        return distance(p, l);
    }

    Containment contains(const Segment &l, const Point &p) {
        return sgn(distance(l, p)) == 0 ? Containment::ON : Containment::OUT;
    }
    Containment contains(const Ray &l, const Point &p) {
        return sgn(distance(l, p)) == 0 ? Containment::ON : Containment::OUT;
    }
    Containment contains(const Line &l, const Point &p) {
        return sgn(distance(l, p)) == 0 ? Containment::ON : Containment::OUT;
    }

    bool equals(const Line &l, const Line &m) {
        return on_the_same_line(l, m);
    }
    bool equals(const Ray &l, const Ray &m) {
        return on_the_same_line(l, m) and equals(l.a, m.a);
    }
    bool equals(const Segment &l, const Segment &m) {
        return (equals(l.a, m.a) and equals(l.b, m.b)) or (equals(l.a, m.b) and equals(l.b, m.a));
    }

    // "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_B"
    bool has_common_point(const Segment &l1, const Segment &l2) {
        int isp_1a = isp(l1.a, l1.b, l2.a), isp_1b = isp(l1.a, l1.b, l2.b);
        if (isp_1a * isp_1b > 0) return false;
        int isp_2a = isp(l2.a, l2.b, l1.a), isp_2b = isp(l2.a, l2.b, l1.b);
        if (isp_2a * isp_2b > 0) return false;
        return true;
    }

    namespace internal {
        template <typename line_t_1, typename line_t_2>
        Point cross_point(const line_t_1 &l1, const line_t_2 &l2) {
            assert(not is_parallel(l1, l2));
            Point u = l1.b - l1.a, v = l2.a - l2.b, c = l2.a - l1.a;
            return l2.a - det(u, c) / det(u, v) * v;
        }
    }

    // "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_C"
    std::variant<std::nullptr_t, Point, Segment> common_point(const Segment &l1, const Segment &l2) {
        if (not has_common_point(l1, l2)) return nullptr;
        if (not is_parallel(l1, l2)) return internal::cross_point(l1, l2);
        std::vector<Point> ps { l1.a, l1.b, l2.a, l2.b };
        for (int i = 0; i <= 2; ++i) for (int j = 2; j >= i; --j) {
            if (XY_COMPARATOR(ps[j + 1], ps[j])) std::swap(ps[j], ps[j + 1]);
        }
        if (equals(ps[1], ps[2])) return ps[1];
        return Segment(ps[1], ps[2]);
    }

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
    coordinate_t square_distance(const Segment &l1, const Segment &l2) {
        if (has_common_point(l1, l2)) return 0;
        return std::min({ square_distance(l1, l2.a), square_distance(l1, l2.b), square_distance(l1.a, l2), square_distance(l1.b, l2) });
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_2_D
    coordinate_t distance(const Segment &l1, const Segment &l2) {
        return std::sqrt(square_distance(l1, l2));
    }

    // Polygon

    using Polygon = std::vector<Point>;

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_3_A
    coordinate_t signed_area(const Polygon &poly) {
        coordinate_t res = 0;
        int sz = poly.size();
        for (int i = 0; i < sz; ++i) {
            int j = i + 1;
            if (j == sz) j = 0;
            res += signed_area(ZERO, poly[i], poly[j]);
        }
        return res;
    }
    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_3_C
    Containment contains(const Polygon &poly, const Point &p) {
        bool in = false;
        int sz = poly.size();
        for (int i = 0; i < sz; ++i) {
            int j = i + 1;
            if (j == sz) j -= sz;
            Point a = poly[i] - p, b = poly[j] - p;
            if (a.imag() > b.imag()) std::swap(a, b);
            if (sgn(a.imag()) <= 0 and sgn(b.imag()) > 0 and sgn(det(a, b)) < 0) in = not in;
            if (sgn(det(a, b)) == 0 and sgn(dot(a, b)) <= 0) return Containment::ON;
        }
        return in ? Containment::IN : Containment::OUT;
    }

    // Circle

    // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_7_A
    int tangent_num(const Circle &c1, const Circle &c2) {
        coordinate_t r1 = c1.radius, r2 = c2.radius;
        if (r1 > r2) return tangent_num(c2, c1);
        coordinate_t d = abs(c1.center - c2.center);
        int cp = compare(d, r1 + r2);
        if (cp > 0) return 4;
        if (cp == 0) return 3;
        int cn = compare(d, r2 - r1);
        if (cn > 0) return 2;
        if (cn == 0) return 1;
        return 0;
    }
}
} // namespace suisen

using namespace suisen::geometry;

bool solve() {
    coordinate_t x0, y0, x1, y1, x2, y2;
    std::cin >> x0 >> y0 >> x1 >> y1 >> x2 >> y2;
    if (x0 == 0 and y0 == 0 and x1 == 0 and y1 == 0 and x2 == 0 and y2 == 0) return false;
    Point A { x0, y0 }, B { x1, y1 }, C { x2, y2 };
    Polygon ABC { A, B, C };
    Point O = pI(A, B, C).center;

    Point dA = (O - A) / abs(O - A);
    Point dB = (O - B) / abs(O - B);
    Point dC = (O - C) / abs(O - C);

    coordinate_t sA = abs(projection(A + dA, Line { A, B }) - (A + dA));
    coordinate_t sB = abs(projection(B + dB, Line { B, C }) - (B + dB));
    coordinate_t sC = abs(projection(C + dC, Line { C, A }) - (C + dC));

    coordinate_t cA = sqrtl(std::max(coordinate_t(0), 1 - sA * sA));
    coordinate_t cB = sqrtl(std::max(coordinate_t(0), 1 - sB * sB));
    coordinate_t cC = sqrtl(std::max(coordinate_t(0), 1 - sC * sC));

    coordinate_t AB = abs(B - A);
    coordinate_t BC = abs(C - B);
    coordinate_t CA = abs(A - C);

    coordinate_t ans_x = 0, ans_y = 0, ans_z = 0;

    coordinate_t lx = 0, rx = std::min(coordinate_t(5000), std::min(CA, AB) / cA);
    for (int loop_x = 0; loop_x < 128; ++loop_x) {
        coordinate_t x = (lx + rx) / 2;
        Point X = A + x * dA;
        coordinate_t hX = x * sA;
        if (contains(ABC, X + dA * hX) == Containment::OUT) {
            rx = x;
            continue;
        }
        Circle cX { X, hX };

        coordinate_t ly = 0, ry = std::min(coordinate_t(5000), std::min(AB, BC) / cB);
        for (int loop_y = 0; loop_y < 128; ++loop_y) {
            coordinate_t y = (ly + ry) / 2;
            Point Y = B + y * dB;
            if (contains(ABC, Y) == Containment::OUT) {
                ry = y;
                continue;
            }
            coordinate_t hY = y * sB;
            Circle cY { Y, hY };
            if (tangent_num(cX, cY) == 4) {
                ly = y;
            } else {
                ry = y;
            }
        }
        coordinate_t y = ry;
        Point Y = B + y * dB;
        coordinate_t hY = y * sB;
        Circle cY { Y, hY };
        if (tangent_num(cX, cY) < 3) {
            lx = x;
            continue;
        }

        coordinate_t lz = 0, rz = std::min(coordinate_t(5000), std::min(BC, CA) / cC);
        for (int loop_z = 0; loop_z < 128; ++loop_z) {
            coordinate_t z = (lz + rz) / 2;
            Point Z = C + z * dC;
            if (contains(ABC, Z) == Containment::OUT) {
                rz = z;
                continue;
            }
            coordinate_t hZ = z * sC;
            Circle cZ { Z, hZ };
            if (tangent_num(cX, cZ) == 4) {
                lz = z;
            } else {
                rz = z;
            }
        }

        coordinate_t z = rz;
        Point Z = C + z * dC;
        coordinate_t hZ = z * sC;
        Circle cZ { Z, hZ };
        if (tangent_num(cX, cZ) < 3) {
            lx = x;
            continue;
        }

        if (tangent_num(cY, cZ) == 4) {
            rx = x;
        } else {
            lx = x;
        }

        ans_x = hX, ans_y = hY, ans_z = hZ;
    }
    std::cout << ans_x << ' ' << ans_y << ' ' << ans_z << std::endl;
    return true;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(6);

    while (solve());
    return 0;
}
accuracy: 1
time_ms: 3650
memory_kb: 3608
final_rank: 19

code_snippet: #include <bits/stdc++.h>
using namespace std;

//geometry library by maine

//basic
using Real = double;
using Point = complex<Real>;
#define x real()
#define y imag()
const Real EPS = 1e-8, PI = acos(-1), INF = 1e10;

istream& operator>>(istream& is, Point& p) {
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}
ostream& operator<<(ostream& os, Point p) {
    return os << fixed << setprecision(10) << p.x << " " << p.y;
}

Point operator*(const Point& p, const Real& d) { return Point(p.x * d, p.y * d); }

namespace std {
bool operator<(const Point& a, const Point& b) {
    return a.x != b.x ? a.x < b.x : a.y < b.y;
}
}  // namespace std

Real get_angle(const Point& a, const Point& b, const Point& c) {
    return arg((c - a) / (b - a));
}

//unit vector
Point e(const Point& p) { return p / abs(p); }

//angle transformation
Real radian_to_degree(Real r) { return r * 180.0 / PI; }
Real degree_to_radian(Real d) { return d * PI / 180.0; }

//basic functions
bool eq(const Real& r, const Real& s) { return abs(r - s) < EPS; }
bool eq(const Point& p, const Point& q) { return abs(p - q) < EPS; }
Real dot(const Point& p, const Point& q) { return p.x * q.x + p.y * q.y; }
Real cross(const Point& p, const Point& q) { return p.x * q.y - p.y * q.x; }
Point rotate(const Real& theta, const Point& p) {
    return {cos(theta) * p.x - sin(theta) * p.y, sin(theta) * p.x + cos(theta) * p.y};
}

//structs : Line, Segment, Circle
struct Line {
    Point a, b;
    Line() = default;
    Line(Point a, Point b) : a(a), b(b) {}
    Point d() const { return e(b - a); }  //direction vector
    Point n() const {
        Point dd = d();
        return {dd.y, -dd.x};
    }  //normal vector
};
struct Segment : Line {
    Segment() = default;
    Segment(Point a, Point b) : Line(a, b) {}
};
struct Circle {
    Point p;
    Real r;
    Circle() = default;
    Circle(Point p, Real r) : p(p), r(r){};
};
using Points = vector<Point>;
using Polygon = vector<Point>;
using Polygons = vector<Polygon>;
using Lines = vector<Line>;
using Segments = vector<Segment>;
using Circles = vector<Circle>;

//happy functions
//https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C
int ccw(const Point& a, const Point& bb, const Point& cc) {
    Point b = bb - a, c = cc - a;
    if (cross(b, c) > EPS)
        return 1;  //COUNTER_CLOCKWISE
    if (cross(b, c) < -EPS)
        return -1;  //CLOCKWISE
    if (dot(b, c) < 0)
        return 2;  //ONLINE_BACK  c-a-b
    if (norm(b) < norm(c))
        return -2;  //ONLINE_FRONT a-b-c
    return 0;       //ON_SEGMENT   a-c-b
}

bool parallel(const Line& l, const Line& m) { return eq(cross(l.d(), m.d()), 0.0); }
bool orthogonal(const Line& l, const Line& m) { return eq(dot(l.d(), m.d()), 0.0); }
Point projection(const Line& l, const Point& p) { return p + l.n() * dot(l.a - p, l.n()); }
Point reflection(const Line& l, const Point& p) { return p + l.n() * 2.0 * dot(l.a - p, l.n()); }

//intersect
bool intersect(const Line& l, const Point& p) { return abs(ccw(l.a, l.b, p)) != 1; }
bool intersect(const Line& l, const Line& m) { return !parallel(l, m) || (parallel(l, m) && intersect(l, m.a)); }
bool intersect(const Segment& s, const Point& p) { return ccw(s.a, s.b, p) == 0; }
bool intersect(const Line& l, const Segment& s) { return cross(l.d(), s.a - l.a) * cross(l.d(), s.b - l.a) < EPS; }
bool intersect(const Segment& s, const Segment& t) {
    return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}

//distance
Real distance(const Point& p, const Point& q) { return abs(p - q); }
Real distance(const Line& l, const Point& p) { return distance(p, projection(l, p)); }
Real distance(const Line& l, const Line& m) { return intersect(l, m) ? 0 : distance(l, m.a); }
Real distance(const Segment& s, const Point& p) {
    Point q = projection(s, p);
    return intersect(s, q) ? distance(p, q) : min(distance(s.a, p), distance(s.b, p));
}
Real distance(const Segment& s, const Segment& t) { return intersect(s, t) ? 0 : min({distance(s, t.a), distance(s, t.b), distance(t, s.a), distance(t, s.b)}); }
Real distance(const Line& l, const Segment& s) { return intersect(l, s) ? 0 : min(distance(l, s.a), distance(l, s.b)); }

//intersect circle
bool intersect(const Circle& c, const Point& p) { return eq(distance(c.p, p), c.r); }
bool intersect(const Circle& c, const Line& l) { return distance(l, c.p) <= c.r + EPS; }
int intersect(const Circle& c, const Segment& s) {
    if (!intersect(c, Line(s)))
        return 0;
    Real da = distance(c.p, s.a), db = distance(c.p, s.b);
    if (da < c.r + EPS && db < c.r + EPS)
        return 0;
    if (da > db)
        swap(da, db);
    if (da < c.r - EPS && db > c.r + EPS)
        return 1;
    if (intersect(s, projection(s, c.p)))
        return 2;
    return 0;
}
int intersect(Circle c1, Circle c2) {
    if (c1.r < c2.r)
        swap(c1, c2);
    Real d = distance(c1.p, c2.p);
    if (c1.r + c2.r < d)
        return 4;
    if (eq(c1.r + c2.r, d))
        return 3;
    if (c1.r - c2.r < d)
        return 2;
    if (eq(c1.r - c2.r, d))
        return 1;
    return 0;
}

//crosspoint
Point crosspoint(const Line& l, const Line& m) {
    Real A = cross(m.a - l.a, m.d()), B = cross(l.d(), m.d());
    if (eq(A, 0.0) && eq(B, 0.0))
        return m.a;
    return l.a + l.d() * A / B;
}
Point crosspoint(const Segment& s, const Segment& t) { return crosspoint(Line(s), Line(t)); }
pair<Point, Point> crosspoint(const Circle& c, const Line& l) {
    Point p = projection(l, c.p);
    if (eq(distance(l, c.p), c.r))
        return {p, p};
    Real len = sqrt(c.r * c.r - norm(p - c.p));
    return {p + len * l.d(), p - len * l.d()};
}
pair<Point, Point> crosspoint(const Circle& c, const Segment& s) {
    Line l(s);
    if (intersect(c, s) == 2)
        return crosspoint(c, l);
    auto ret = crosspoint(c, l);
    if (dot(s.a - ret.first, s.b - ret.first) < 0)
        ret.second = ret.first;
    else
        ret.first = ret.second;
    return ret;
}
pair<Point, Point> crosspoint(const Circle& c1, const Circle& c2) {
    Real d = distance(c1.p, c2.p);
    Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    Real t = atan2(c2.p.y - c1.p.y, c2.p.x - c1.p.x);
    Point p1 = c1.p + Point(cos(t + a) * c1.r, sin(t + a) * c1.r);
    Point p2 = c1.p + Point(cos(t - a) * c1.r, sin(t - a) * c1.r);
    return {p1, p2};
}

//tangent
pair<Point, Point> tangent(const Circle& c, const Point& p) {
    return crosspoint(c, Circle(p, sqrt(norm(c.p - p) - c.r * c.r)));
}
Lines tangent(Circle c1, Circle c2) {
    Lines ret;
    if (c1.r < c2.r)
        swap(c1, c2);
    if (eq(c1.p, c2.p))
        return ret;
    Real g = norm(c1.p - c2.p);
    Point u = (c2.p - c1.p) / sqrt(g);
    Point v = rotate(PI / 2, u);
    for (int s : {-1, 1}) {
        Real h = (c1.r + s * c2.r) / sqrt(g);
        if (eq(1 - h * h, 0)) {
            ret.emplace_back(c1.p + u * c1.r, c1.p + (u + v) * c1.r);
        } else if (1 - h * h > 0) {
            Point uu = u * h, vv = v * sqrt(1 - h * h);
            ret.emplace_back(c1.p + (uu + vv) * c1.r, c2.p - (uu + vv) * c2.r * s);
            ret.emplace_back(c1.p + (uu - vv) * c1.r, c2.p - (uu - vv) * c2.r * s);
        }
    }
    return ret;
}

//convex
bool is_convex(const Polygon& P) {
    int N = (int)P.size();
    for (int i = 0; i < N; i++) {
        if (ccw(P[i], P[(i + 1) % N], P[(i + 2) % N]) == -1)
            return false;
    }
    return true;
}
Polygon convex_hull(Points P) {
    int N = (int)P.size(), k = 0;
    if (N <= 2)
        return P;
    sort(begin(P), end(P));
    Points ret(2 * N);
    for (int i = 0; i < N; ret[k++] = P[i++]) {
        while (k >= 2 && cross(ret[k - 1] - ret[k - 2], P[i] - ret[k - 1]) < EPS)
            --k;
    }
    for (int i = N - 2, t = k + 1; i >= 0; ret[k++] = P[i--]) {
        while (k >= t && cross(ret[k - 1] - ret[k - 2], P[i] - ret[k - 1]) < EPS)
            --k;
    }
    ret.resize(k - 1);
    return ret;
}

//other
enum
{
    OUT,
    ON,
    IN
};

int contains(const Polygon& Q, const Point& p) {
    bool in = false;
    int N = (int)Q.size();
    for (int i = 0; i < N; i++) {
        Point a = Q[i] - p, b = Q[(i + 1) % N] - p;
        if (a.y > b.y)
            swap(a, b);
        if (a.y <= 0 && 0 < b.y && cross(a, b) < 0)
            in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0)
            return ON;
    }
    return in ? IN : OUT;
}

Real area(const Polygon& P) {
    Real A = 0;
    for (int i = 0; i < (int)P.size(); i++) {
        A += cross(P[i], P[(i + 1) % P.size()]);
    }
    return A * 0.5;
}


int main() {
    Point A, B, C;
    while (cin >> A >> B >> C, A != B) {
        Segment a{B, C}, b{A, C}, c{A, B};
        Circle Ca, Cb, Cc;

        auto check = [&](double len) {
            double angle_A = get_angle(A, B, C);
            Point D{A + rotate(angle_A / 2, B - A)};
            Line d{A, D};
            Ca.p = A + (D - A) / abs(D - A) * len;
            Ca.r = distance(Line{c}, Ca.p);
            if (intersect(Ca, Line{a}) || intersect(a, Segment{A, Ca.p}))
                return false;


            auto calc_circle = [&](Point A, Point B, Point C, Segment a, Segment b, Segment c, Circle Ca) {
                Circle ret;
                double angle_B = arg((A - B) / (C - B));
                Point E{B + rotate(angle_B / 2, C - B)};
                Line e{B, E};
                auto check2 = [&](double len) {
                    ret.p = B + (E - B) / abs(E - B) * len;
                    ret.r = distance(Line{a}, ret.p);
                    if (intersect(ret, Line{b}) || intersect(b, Segment{B, ret.p}))
                        return false;
                    return intersect(ret, Ca) >= 3;
                };

                double ok = 0;
                double ng = 20000;
                while (abs(ok - ng) > EPS) {
                    double mid = (ok + ng) / 2;
                    if (check2(mid)) {
                        ok = mid;
                    } else {
                        ng = mid;
                    }
                }

                return ret;
            };

            Cb = calc_circle(A, B, C, a, b, c, Ca);
            Cc = calc_circle(B, C, A, b, c, a, Ca);

            return intersect(Cb, Cc) < 3;
        };

        double ok = 0;
        double ng = 3000;
        while (abs(ok - ng) > EPS) {
            double mid = (ok + ng) / 2;
            if (check(mid)) {
                ok = mid;
            } else {
                ng = mid;
            }
        }
        cout << fixed << setprecision(6) << Ca.r << " " << Cb.r << " " << Cc.r << endl;
    }
}
accuracy: 1
time_ms: 650
memory_kb: 3908
final_rank: 16

code_snippet: #include <bits/stdc++.h>
using namespace std;
struct point{
  double x, y;
  point(){
  }
  point(double x, double y): x(x), y(y){
  }
  point operator +(point P){
    return point(x + P.x, y + P.y);
  }
  point operator -(point P){
    return point(x - P.x, y - P.y);
  }
  point operator *(double k){
    return point(x * k, y * k);
  }
  point operator /(double k){
    return point(x / k, y / k);
  }
};
double abs(point P){
  return sqrt(P.x * P.x + P.y * P.y);
}
double dist(point P, point Q){
  return abs(Q - P);
}
double dot(point P, point Q){
  return P.x * Q.x + P.y * Q.y;
}
double cross(point P, point Q){
  return P.x * Q.y - P.y * Q.x;
}
double area(point P1, point P2, point P3){
  return abs(cross(P2 - P1, P3 - P1)) / 2;
}
double angle(point P, point Q, point R){
  return acos(dot(P - Q, R - Q) / abs(P - Q) / abs(R - Q)); 
}
point incenter(point P1, point P2, point P3){
  double d1 = dist(P2, P3);
  double d2 = dist(P3, P1);
  double d3 = dist(P1, P2);
  return (P1 * d1 + P2 * d2 + P3 * d3) / (d1 + d2 + d3);
}
double inscribled_circle(point P1, point P2, point P3){
  return area(P1, P2, P3) * 2 / (dist(P1, P2) + dist(P2, P3) + dist(P3, P1));
}
int main(){
  cout << fixed << setprecision(10);
  while (true){
    point P1, P2, P3;
    cin >> P1.x >> P1.y >> P2.x >> P2.y >> P3.x >> P3.y;
    if (P1.x == 0 && P1.y == 0 && P2.x == 0 && P2.y == 0 && P3.x == 0 && P3.y == 0){
      break;
    }
    double t1 = angle(P3, P1, P2), t2 = angle(P1, P2, P3), t3 = angle(P2, P3, P1);
    point I = incenter(P1, P2, P3);
    double r = inscribled_circle(P1, P2, P3);
    double r1, r2, r3;
    double tv = 0, fv = dist(P1, I);
    for (int i = 0; i < 50; i++){
      double mid = (tv + fv) / 2;
      r1 = mid * sin(t1 / 2);
      point C1 = P1 + (I - P1) / abs(I - P1) * mid;
      point C2;
      double tv2 = 0, fv2 = dist(P2, I);
      for (int j = 0; j < 50; j++){
        double mid2 = (tv2 + fv2) / 2;
        r2 = mid2 * sin(t2 / 2);
        C2 = P2 + (I - P2) / abs(I - P2) * mid2;
        if (dist(C1, C2) > r1 + r2){
          tv2 = mid2;
        } else {
          fv2 = mid2;
        }
      }
      point C3;
      double tv3 = 0, fv3 = dist(P3, I);
      for (int j = 0; j < 50; j++){
        double mid3 = (tv3 + fv3) / 2;
        r3 = mid3 * sin(t3 / 2);
        C3 = P3 + (I - P3) / abs(I - P3) * mid3;
        if (dist(C1, C3) > r1 + r3){
          tv3 = mid3;
        } else {
          fv3 = mid3;
        }
      }
      if (dist(C2, C3) < r2 + r3){
        tv = mid;
      } else {
        fv = mid;
      }
    }
    cout << r1 << ' ' << r2 << ' ' << r3 << endl;
  }
}
accuracy: 1
time_ms: 200
memory_kb: 3532
final_rank: 11

code_snippet: #include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;

#define REP(i,n) for (int i=0; i<(n); ++i)
#define RREP(i,n) for (int i=(int)(n)-1; i>=0; --i)
#define FOR(i,a,n) for (int i=(a); i<(n); ++i)
#define RFOR(i,a,n) for (int i=(int)(n)-1; i>=(a); --i)

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    REP (i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}

template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<class T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}

const ll MOD = 1e9+7;
const ld eps = 1e-9;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template<typename T>
struct edge {
    int src, to;
    T cost;

    friend ostream &operator<<(ostream &os, const edge &e) {
        return os << "(" << e.src << "->" << e.to << ":" << e.cost << ")";
    }
};

template<typename T>
using Graph = vector<vector<edge<T>>>;


template<int64_t mod>
class modint {
    int64_t x;

public:
    modint(int64_t x = 0) : x(x < 0 ? ((x % mod) + mod) % mod : x % mod) {}

    const modint operator-() const { return x ? mod - x : 0; }

    modint &operator+=(const modint &rhs) {
        if ((x += rhs.x) >= mod) x -= mod;
        return *this;
    }

    modint &operator-=(const modint &rhs) {
        return *this += -rhs;
    }

    modint &operator*=(const modint &rhs) {
        (x *= rhs.x) %= mod;
        return *this;
    }

    modint &operator/=(const modint &rhs) {
        return *this *= rhs.pow(mod - 2);
    }

    friend const modint operator+(modint lhs, const modint &rhs) {
        return lhs += rhs;
    }

    friend const modint operator-(modint lhs, const modint &rhs) {
        return lhs -= rhs;
    }

    friend const modint operator*(modint lhs, const modint &rhs) {
        return lhs *= rhs;
    }

    friend const modint operator/(modint lhs, const modint &rhs) {
        return lhs /= rhs;
    }

    const modint pow(int64_t n) const {
        modint ret = 1, tmp = *this;
        while (n) {
            if (n & 1) ret *= tmp;
            tmp *= tmp;
            n >>= 1;
        }
        return ret;
    }

    friend bool operator==(const modint &lhs, const modint &rhs) {
        return lhs.x == rhs.x;
    }

    friend bool operator!=(const modint &lhs, const modint &rhs) {
        return !(lhs == rhs);
    }

    friend ostream &operator<<(ostream &os, const modint &a) {
        return os << a.x;
    }

    friend istream &operator>>(istream &is, modint &a) {
        int64_t tmp;
        is >> tmp;
        a = tmp;
        return is;
    }
};


/**
 * @brief
 * 二次元幾何
 * @author habara-k
 * @date 2020/05/05
 */

using Real = double;
const Real PI = acos(-1);

using Point = complex<Real>;
namespace std {
    bool operator<(const Point &a, const Point &b) {
        if (a.real() == b.real()) return a.imag() < b.imag();
        return a.real() < b.real();
    }
}

struct Line {
    Point a, b;

    Line() {}

    Line(const Point &a, const Point &b) : a(a), b(b) {}

    friend ostream &operator<<(ostream &os, const Line &l) {
        return os << "[" << l.a << "," << l.b << "]";
    }
};

struct Segment : Line {
    Segment() {}

    Segment(const Point &a, const Point &b) : Line(a, b) {}
};

inline bool eq(Real a, Real b) { return abs(b - a) < eps; }

Real radian_to_degree(Real r) {
    return r * 180.0 / PI;
}

Real degree_to_radian(Real d) {
    return d * PI / 180.0;
}

Point rotate(const Point &p, Real theta) {
    return p * polar((Real) 1.0, theta);
}

Real cross(const Point &a, const Point &b) {
    return a.real() * b.imag() - a.imag() * b.real();
}

Real dot(const Point &a, const Point &b) {
    return a.real() * b.real() + a.imag() * b.imag();
}


/**
* @brief 点p の直線l への射影を求める.
*/
Point projection(const Line &l, const Point &p) {
    Real A = dot(l.b - l.a, p - l.a),
            B = dot(l.a - l.b, p - l.b);
    return (A * l.b + B * l.a) / (A + B);
}

/**
* @brief 2直線の並行判定
*/
bool parallel(const Line &l1, const Line &l2) {
    return eq(cross(l1.a - l1.b, l2.a - l2.b), 0.0);
}

/**
* @brief 2直線の直行判定
*/
bool orthogonal(const Line &l1, const Line &l2) {
    return eq(dot(l1.a - l1.b, l2.a - l2.b), 0.0);
}


/**
* @brief 有向線分と点の位置関係
* @param[in] a, b, c: 線分a->b, 点c
* @return 線分a->b からみて, 点c がどこにあるか.
*/
const int COUNTER_CLOCKWISE = 1,
        CLOCKWISE = -1,
        ONLINE_BACK = 2,
        ONLINE_FRONT = -2,
        ON_SEGMENT = 0;

int ccw(const Point &a, Point b, Point c) {
    b = b - a, c = c - a;
    if (cross(b, c) > eps) return COUNTER_CLOCKWISE;
    if (cross(b, c) < -eps) return CLOCKWISE;
    if (dot(b, c) < 0) return ONLINE_BACK;
    if (norm(b) < norm(c)) return ONLINE_FRONT;
    return ON_SEGMENT;
}


/**
* @brief 直線と点の交差判定
*/
bool intersected(const Line &l, const Point &p) {
    return abs(ccw(l.a, l.b, p)) != 1;
}

/**
* @brief 線分と点の交差判定
*/
bool intersected(const Segment &s, const Point &p) {
    return ccw(s.a, s.b, p) == 0;
}

/**
* @brief 直線と線分の交差判定
*/
bool intersected(const Line &l, const Segment &s) {
    return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) < eps;
}

/**
* @brief 2つの線分の交差判定
*/
bool intersected(const Segment &s1, const Segment &s2) {
    return ccw(s1.a, s1.b, s2.a) * ccw(s1.a, s1.b, s2.b) <= 0 and
           ccw(s2.a, s2.b, s1.a) * ccw(s2.a, s2.b, s1.b) <= 0;
}


/**
* @brief 2直線の交点
*/
Point crosspoint(const Line &l1, const Line &l2) {
    Real A = cross(l2.a - l1.a, l2.b - l1.a),
            B = cross(l2.b - l1.b, l2.a - l1.b);
    return (A * l1.b + B * l1.a) / (A + B);
}


/**
* @brief 直線と点の距離
*/
Real distance(const Line &l, const Point &p) {
    return abs(p - projection(l, p));
}

/**
* @brief 線分と点の距離
*/
Real distance(const Segment &s, const Point &p) {
    Point r = projection(s, p);
    if (intersected(s, r)) return abs(r - p);
    return min(abs(s.a - p), abs(s.b - p));
}

/**
* @brief 直線と線分の距離
*/
Real distance(const Line &l, const Segment &s) {
    if (intersected(l, s)) return 0;
    return min(distance(l, s.a), distance(l, s.b));
}

/**
* @brief 2つの線分の距離
*/
Real distance(const Segment &s1, const Segment &s2) {
    if (intersected(s1, s2)) return 0.0;
    return min({distance(s1, s2.a), distance(s1, s2.b),
                distance(s2, s1.a), distance(s2, s1.b)});
}


struct Circle {
    Point p;
    Real r;

    Circle() {}

    Circle(const Point &p, Real r) : p(p), r(r) {}
};


/**
* @brief 2つの円の交点の数
*/
int intersected(Circle c1, Circle c2) {
    if (c1.r < c2.r) swap(c1, c2);
    Real d = abs(c1.p - c2.p);
    if (c1.r + c2.r < d) return 4;
    if (eq(c1.r + c2.r, d)) return 3;
    if (c1.r - c2.r < d) return 2;
    if (eq(c1.r - c2.r, d)) return 1;
    return 0;
}

/**
* @brief 円と直線の交点のペア
* @details 交差することを確認してから呼ぶこと.
*/
pair<Point, Point> crosspoint(const Circle &c, const Line &l) {
    Real h = distance(l, c.p);
    Point p = projection(l, c.p);
    if (eq(h, c.r)) return {p, p};
    Point u = l.a - l.b;
    u /= abs(u);
    Real d = sqrt(c.r * c.r - h * h);
    return {p + u * d, p - u * d};
}

/**
* @brief 2つの円の交点のペア
* @details 交差することを確認してから呼ぶこと.
*/
pair<Point, Point> crosspoint(const Circle &c1, const Circle &c2) {
    Real d = abs(c2.p - c1.p), t = arg(c2.p - c1.p);
    Real a = acos((c1.r * c1.r + d * d - c2.r * c2.r) / (2 * c1.r * d));
    return {c1.p + polar(c1.r, t + a),
            c1.p + polar(c1.r, t - a)};
}

/**
* @brief 点p, 円c に対し, pを通るcの接線を返す(c上の2点のペアで返す).
* @details 点p が円c の外側にあることを確認してから呼ぶこと.
*/
pair<Point, Point> tangent(const Point &p, const Circle &c) {
    return crosspoint(c, Circle(p, sqrt(norm(p - c.p) - c.r * c.r)));
};

/**
* @brief 2つの円に共通する接線を返す(最大4本).
* @details 点p が円c の外側にあることを確認してから呼ぶこと.
*/
vector<Line> common_tangent(const Circle &c1, const Circle &c2) {
    vector<Line> lines;
    Point u = c2.p - c1.p;
    Real d = abs(u);
    if (eq(d, 0.0)) return lines;
    u /= d;
    for (Real s : {-1, 1}) {
        // s = -1: 同じ側に2つの円があるとき.
        // s =  1: 反対側に2つの円があるとき.
        Real h = (c1.r + s * c2.r) / d;
        if (eq(abs(h), 1.0)) {
            // 2つの円が接しているとき.
            lines.emplace_back(
                    c1.p + u * h * c1.r,
                    c1.p + u * h * c1.r + rotate(u, PI / 2.0));
        } else if (abs(h) < 1) {
            // 2本の接線が引けるとき.
            Real a = acos(h);
            lines.emplace_back(
                    c1.p + u * polar(c1.r, a),
                    c2.p - s * u * polar(c2.r, a));
            lines.emplace_back(
                    c1.p + u * polar(c1.r, -a),
                    c2.p - s * u * polar(c2.r, -a));
        }
    }
    return lines;
}


bool solve() {
    vector<Point> ps(3);
    vector<Line> ls(3), cs(3);
    REP(i, 3) {
        Real x, y; cin >> x >> y;
        ps[i] = {x, y};
    }
    if (abs(ps[0]) + abs(ps[1]) + abs(ps[2]) < eps) return false;
    REP(i, 3) {
        ls[i] = {ps[(i+1) % 3], ps[(i+2) % 3]};
        Point a = ps[(i+1) % 3] - ps[i];
        Point b = ps[(i+2) % 3] - ps[i];
        a /= abs(a);
        b /= abs(b);
        Point d = a + b;
        cs[i] = {ps[i], ps[i] + d};
    }

    Point c = crosspoint(cs[0], cs[1]);

    Real r0, r1, r2;
    auto check = [&](Point q0) {
        r0 = distance(ls[1], q0);

        Point p1, p2;
        {
            auto check1 = [&](Point q1) {
                r1 = distance(ls[0], q1);
                return abs(q0 - q1) > r0 + r1;
            };
            Point lb = ps[1], ub = c;
            while (abs(ub - lb) > eps) {
                Point mid = (ub + lb) / 2.0;
                (check1(mid) ? lb : ub) = mid;
            }
            p1 = lb;
        }
        {
            auto check2 = [&](Point q2) {
                r2 = distance(ls[0], q2);
                return abs(q0 - q2) > r0 + r2;
            };
            Point lb = ps[2], ub = c;
            while (abs(ub - lb) > eps) {
                Point mid = (ub + lb) / 2.0;
                (check2(mid) ? lb : ub) = mid;
            }
            p2 = lb;
        }

        return abs(p1 - p2) < r1 + r2;

    };

    Point lb = ps[0], ub = c;
    while (abs(ub - lb) > eps) {
        Point mid = (ub + lb) / 2.0;
        (check(mid) ? lb : ub) = mid;
    }

    cout << r0 << ' ' << r1 << ' ' << r2 << endl;

    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    while (solve()) {}

    return 0;
}
accuracy: 1
time_ms: 340
memory_kb: 3384
final_rank: 4

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;
#define double long double

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

double len(double r1, double r2, double t1, double t2) {
  double val1 = r1 * abs(tan(acos(-1) / 2.0 - t1 / 2.0));
  double val2 = r2 * abs(tan(acos(-1) / 2.0 - t2 / 2.0));
  double val3 = 2 * sqrt(r1 * r2);
  return val1 + val2 + val3;
}

bool solve() {
  vector<double> x(3), y(3);
  bool end = true;
  REP(i, 3) {
    int u, v; cin >> u >> v;
    end &= u == 0 && v == 0;
    x[i] = u;
    y[i] = v;
  }
  if(end) return false;

  double t1 = abs(arg(complex<double>(x[1] - x[0], y[1] - y[0])) - arg(complex<double>(x[2] - x[0], y[2] - y[0])));
  double t2 = abs(arg(complex<double>(x[2] - x[1], y[2] - y[1])) - arg(complex<double>(x[0] - x[1], y[0] - y[1])));
  double t3 = abs(arg(complex<double>(x[0] - x[2], y[0] - y[2])) - arg(complex<double>(x[1] - x[2], y[1] - y[2])));
  chmin(t1, 2 * acos(-1) - t1);
  chmin(t2, 2 * acos(-1) - t2);
  chmin(t3, 2 * acos(-1) - t3);
  double len1 = abs(complex<double>(x[0], y[0]) - complex<double>(x[1], y[1]));
  double len2 = abs(complex<double>(x[1], y[1]) - complex<double>(x[2], y[2]));
  double len3 = abs(complex<double>(x[2], y[2]) - complex<double>(x[0], y[0]));


  double l1 = 0, r1 = 100000;
  REP(_, 60) {
    double mid1 = (l1 + r1) / 2.0;

    double l2 = 0, r2 = 100000;
    REP(_, 60) {
      double mid2 = (l2 + r2) / 2.0;
      double l = len(mid1, mid2, t1, t2);
      if(l < len1) {
        l2 = mid2;
      } else {
        r2 = mid2;
      }
    }

    double l3 = 0, r3 = 100000;
    REP(_, 60) {
      double mid3 = (l3 + r3) / 2.0;
      double l = len(mid1, mid3, t1, t3);
      if(l < len3) {
        l3 = mid3;
      } else {
        r3 = mid3;
      }
    }

    double l = len(l2, l3, t2, t3);
    if(l < len2) {
      r1 = mid1;
    } else {
      l1 = mid1;
    }
  }

  double l2 = 0, r2 = 100000;
  REP(_, 60) {
    double mid2 = (l2 + r2) / 2.0;
    double l = len(l1, mid2, t1, t2);
    if(l < len1) {
      l2 = mid2;
    } else {
      r2 = mid2;
    }
  }

  double l3 = 0, r3 = 100000;
  REP(_, 60) {
    double mid3 = (l3 + r3) / 2.0;
    double l = len(l1, mid3, t1, t3);
    if(l < len3) {
      l3 = mid3;
    } else {
      r3 = mid3;
    }
  }

  cout << l1 << " " << l2 << " " << l3 << endl;


  return true;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  while(solve()) {}

  return 0;

}
accuracy: 1
time_ms: 3420
memory_kb: 3596
final_rank: 17

code_snippet: #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<stack>
#include<bitset>
#include<numeric>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define stop char nyaa;cin>>nyaa;
const ll mod = 1000000007;
const long double eps = 1e-8;
typedef pair<int, int> P;

typedef long double ld;

#include<complex>
typedef complex<ld> Point;
const ld pi = acos(-1.0);
ld dot(Point a, Point b) { return real(conj(a)*b); }
ld cross(Point a, Point b) { return imag(conj(a)*b); }
namespace std {
	bool operator<(const Point &lhs, const Point &rhs) {
		return lhs.real() == rhs.real() ? lhs.imag() < rhs.imag() : lhs.real() < rhs.real();
	}
}
struct Line {
	Point a, b;
};
struct Circle {
	Point p; ld r;
};
int ccw(Point a, Point b, Point c) {
	b -= a; c -= a;
	if (cross(b, c) > eps)return 1;//counter clockwise
	if (cross(b, c) < -eps)return -1;//clock wise
	if (dot(b, c) < 0)return 2;//c--a--b on line
	if (norm(b) < norm(c))return -2;//a--b--c on line
	return 0; //a--c--b on line
}
Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + t * (l.a - l.b);
}
ld dist_lp(Line l, Point p) {
	return abs(p - proj(l, p));
}
bool isis_ss(Line s, Line t) {
	return(cross(s.b - s.a, t.a - s.a)*cross(s.b - s.a, t.b - s.a) < -eps && cross(t.b - t.a, s.a - t.a)*cross(t.b - t.a, s.b - t.a) < -eps);
}
vector<Point> is_cc(Circle c1, Circle c2) {
	vector<Point> res;
	ld d = abs(c1.p - c2.p);
	ld rc = (d*d + c1.r*c1.r - c2.r*c2.r) / (2 * d);
	ld dfr = c1.r*c1.r - rc * rc;
	if (abs(dfr) < eps)dfr = 0.0;
	if (dfr < 0.0)return res;
	ld rs = sqrt(dfr);
	Point diff = (c2.p - c1.p) / d;
	res.push_back(c1.p + diff * Point(rc, rs));
	if (dfr != 0.0)res.push_back(c1.p + diff * Point(rc, -rs));
	return res;
}
vector<Point> is_lc(Circle c, Line l) {
	vector<Point> res;
	ld d = dist_lp(l, c.p);
	if (d > c.r + eps)return res;
	ld len = (d > c.r) ? 0.0 : sqrt(c.r*c.r - d * d);
	Point nor = (l.a - l.b) / abs(l.a - l.b);
	res.push_back(proj(l, c.p) + len * nor);
	res.push_back(proj(l, c.p) - len * nor);
	return res;
}
vector<Point> is_sc(Circle c, Line s) {
	vector<Point> res, cop; cop = is_lc(c, s);
	int len = cop.size();
	rep(k, len) {
		if (ccw(s.a, cop[k], s.b) == -2) {
			res.push_back(cop[k]);
		}
	}
	return res;
}
bool isis_sp(Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}
ld dist_sp(Line s, Point p) {
	Point r = proj(s, p);
	return isis_sp(s, r) ? abs(p - r) : min(abs(p - s.a), abs(p - s.b));
}

Point p[3];
ld dist(int i, int j) {
	ld dx = real(p[j]) - real(p[i]), dy = imag(p[j]) - imag(p[i]);
	return sqrt(dx*dx + dy * dy);
}
ld calc_cos(ld d1, ld d2, ld d3) {
	return (d1*d1 + d2 * d2 - d3 * d3) / (2 * d1*d2);
}


void solve() {
	ld thec[3];
	thec[0] = calc_cos(dist(0, 1), dist(0, 2), dist(1, 2));
	thec[1] = calc_cos(dist(1, 0), dist(1, 2), dist(0, 2));
	thec[2] = calc_cos(dist(2, 1), dist(0, 2), dist(1, 0));
	rep(i, 3) {
		thec[i] = acos(thec[i]);
	}
	Point d[3];
	rep(i, 3) {
		int j = (i + 1) % 3, k = (i + 2) % 3;
		Point l = p[j] - p[i], r = p[k] - p[i];
		l = l / abs(l); r = r / abs(r);
		Point mid = l + r;
		mid = mid / abs(mid);
		d[i] = mid;
	}
	Circle c1, c2, c3;
	ld le = 0, ri = 3000;
	rep(aa, 50) {
		ld mid = (le + ri)/2.0;
		c1.p = p[0] + mid * d[0];
		c1.r = mid * sin(thec[0] / 2.0);
		if (isis_ss({ p[1],p[2] }, { p[0],c1.p })) {
			ri = mid; continue;
		}
		if (dist_sp({ p[1],p[2] }, c1.p)<c1.r) {
			ri = mid; continue;
		}
		//cout << "hello" << endl;
		bool f = false;
		ld cle = 0, cri = 3000;
		rep(bb, 50) {
			ld cmid = (cle + cri) / 2.0;
			c2.p = p[1] + cmid * d[1];
			c2.r = cmid * sin(thec[1] / 2.0);
			f = true;
			if (isis_ss({ p[0],p[2] }, { p[1],c2.p })) {
				cri = cmid; continue;
			}
			if (dist_sp({ p[0],p[2] }, c2.p) < c2.r) {
				cri = cmid; continue;
			}
			f = false;
			if (is_cc(c1, c2).size() > 0) {
				cri = cmid;
			}
			else cle = cmid;
		}
		if (f) {
			le = mid; continue;
		}
		f = false;
		cle = 0, cri = 3000;
		rep(bb, 50) {
			ld cmid = (cle + cri) / 2.0;
			c3.p = p[2] + cmid * d[2];
			c3.r = cmid * sin(thec[2] / 2.0); 
			f = true;
			if (isis_ss({ p[0],p[1] }, { p[2],c3.p })) {
				cri = cmid; continue;
			}
			if (dist_sp({ p[1],p[0] }, c3.p)<c3.r) {
				cri = cmid; continue;
			}
			f = false;
			if (is_cc(c1, c3).size() > 0) {
				cri = cmid;
			}
			else cle = cmid;
		}
		if (f) {
			le = mid; continue;
		}
		//cout << c1.r<<" "<<c2.r << " " << c3.r << endl;
		if (is_cc(c2, c3).size() > 0) {
			le = mid;
		}
		else {
			ri = mid;
		}
	}
	cout << c1.r << " " << c2.r << " " << c3.r << endl;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	while (true) {
		bool f = true;
		rep(i, 3) {
			ld x, y; cin >> x >> y;
			p[i] = { x,y };
			if (x || y)f = false;
		}
		if (f)break;
		solve();
	}
	//stop
		return 0;
}
accuracy: 1
time_ms: 5340
memory_kb: 3552
final_rank: 20

code_snippet: #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef complex<double> C;
 
const double EPS = 1e-10;
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
const ll INF = 100000000;
const ll MOD = 1000000007;
C p[3];

double cross(C a, C b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

C intersection_l(C a1, C a2, C b1, C b2) {
  C a = a2 - a1; C b = b2 - b1;
  return a1 + a * cross(b, b1-a1) / cross(b, a);
}

void solve() {
    double l = min(abs(p[0]-p[1]), abs(p[0]-p[2]));

    double lef = 0.0, rig = l;
    C r1, r2, r3;
    double d1, d2, d3;
    rep(_,100) {
        
        double mid = (lef + rig) / 2.0;
        C mp1 = p[0] + (p[1] - p[0]) / abs(p[1]-p[0]) * mid;
        C mp2 = p[0] + (p[2] - p[0]) / abs(p[2]-p[0]) * mid;
        C mp1t = mp1 + (p[1]-p[0])*C(0,1);
        C mp2t = mp2 + (p[2]-p[0])*C(0,1);
        r1 = intersection_l(mp1, mp1t, mp2, mp2t);
        d1 = abs(r1 - mp1);

        double l_2 = min(abs(p[1]-p[0]), abs(p[1]-p[2]));
        double lef_2 = 0.0, rig_2 = l_2;
        rep(__,100) {
            double mid_2 = (lef_2 + rig_2) / 2.0;
            C mp1_2 = p[1] + (p[0]-p[1]) / abs(p[0]-p[1]) * mid_2;
            C mp2_2 = p[1] + (p[2]-p[1]) / abs(p[2]-p[1]) * mid_2;
            C mp1t_2 = mp1_2 + (p[0]-p[1])*C(0,1);
            C mp2t_2 = mp2_2 + (p[2]-p[1])*C(0,1);
            r2 = intersection_l(mp1_2, mp1t_2, mp2_2, mp2t_2);
            d2 = abs(r2 - mp1_2);
            if (abs(r1-r2) < d1+d2) {
                rig_2 = mid_2;
            } else {
                lef_2 = mid_2;
            }
        }

        l_2 = min(abs(p[2]-p[0]), abs(p[2]-p[1]));
        lef_2 = 0.0, rig_2 = l_2;
        rep(__,100) {
            double mid_2 = (lef_2 + rig_2) / 2.0;
            C mp1_2 = p[2] + (p[0]-p[2]) / abs(p[0]-p[2]) * mid_2;
            C mp2_2 = p[2] + (p[1]-p[2]) / abs(p[1]-p[2]) * mid_2;
            C mp1t_2 = mp1_2 + (p[0]-p[2])*C(0,1);
            C mp2t_2 = mp2_2 + (p[1]-p[2])*C(0,1);
            r3 = intersection_l(mp1_2, mp1t_2, mp2_2, mp2t_2);
            d3 = abs(r3 - mp1_2);
            if (abs(r1-r3) < d1+d3) {
                rig_2 = mid_2;
            } else {
                lef_2 = mid_2;
            }
        }
        if (abs(r2-r3) < d2+d3) {
            lef = mid;
        } else {
            rig = mid;
        }
    }
    printf("%.9f %.9f %.9f\n", d1, d2, d3);
}

int main() {
    int _x[3], _y[3];
    while (cin >> _x[0] >> _y[0] >> _x[1] >> _y[1] >> _x[2] >> _y[2]) {
        bool end = true;
        rep(i,3) {
            if (_x[i] || _y[i]) end = false;
        }
        if (end) break;
        rep(i,3)  p[i] = C(_x[i], _y[i]);
        solve();
    }
}
accuracy: 1
time_ms: 3310
memory_kb: 3140
final_rank: 10

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

typedef long double D;
typedef complex<D> P;

#define X real()
#define Y imag()

const D eps=1e-8;
const D inf=1e12;
const D PI=acos(-1);

D cross(P a,P b){ return (conj(a)*b).Y; }
struct L : public vector<P> { // line and segment
  L(const P& a,const P &b){
    push_back(a);
    push_back(b);
  }
};
P projection(L l,P p){
  P b=l[1]-l[0],c=p-l[0];
  return l[0]+b*(c/b).X;
}
D distanceLP(L l,P p) {
  return abs(p-projection(l,p));
}
P crosspoint(L l,L m) {
  D A=cross(l[1]-l[0],m[1]-m[0]);
  D B=cross(l[1]-l[0],l[1]-m[0]);
  if (abs(A)<eps&&abs(B)<eps) return m[0]; // same line
  if (abs(A)<eps) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
  return m[0]+B/A*(m[1]-m[0]);
}

P p[3],q[3],e[3],x[3];
D r[3];
P g;
P cp;

bool ok(){
  r[0]=distanceLP(L(p[0],p[1]),x[0]);
  repl(i,1,3){
    D lb=0,ub=abs(cp-p[i]);
    rep(hoge,80){
      D mid=(ub+lb)/2.0;
      x[i]=p[i]+e[i]*mid;
      r[i]=distanceLP(L(p[i],p[(i+1)%3]),x[i]);
      D d0i=abs(x[i]-x[0]);
      if(d0i>r[0]+r[i])lb=mid;
      else ub=mid;
    }
  }
  D d12=abs(x[1]-x[2]);
  return d12>r[1]+r[2];
}

int main(){
  while(1){
    bool done=true;
    rep(i,3){
      int x,y;
      cin>>x>>y;
      if(x!=0||y!=0)done=false;
      p[i]=P(x,y);
    }
    if(done)break;

    D absA=abs(p[2]-p[1]); D absB=abs(p[2]-p[0]); D absC=abs(p[1]-p[0]);
    q[0]=(p[1]*absB+p[2]*absC)/(absB+absC);
    q[1]=(p[0]*absA+p[2]*absC)/(absA+absC);
    q[2]=(p[0]*absA+p[1]*absB)/(absA+absB);
    cp=crosspoint(L(p[1],q[1]),L(p[2],q[2]));
    rep(i,3)e[i]=(q[i]-p[i])/abs(q[i]-p[i]);
    D lb=0,ub=abs(cp-p[0]);
    rep(hoge,80){
      D mid=(lb+ub)/2.0;
      x[0]=p[0]+e[0]*mid;
      if(ok())ub=mid;
      else lb=mid;
    }
    printf("%.5Lf %.5Lf %.5Lf\n", r[0], r[1], r[2]);
  }
  return 0;
}
accuracy: 1
time_ms: 6500
memory_kb: 3256
final_rank: 18

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ld = long double;
using P = pair<ld, ld>;
inline ld dist(const P& p1, const P& p2) { return hypot(p1.first - p2.first, p1.second - p2.second); }
int main()
{
    while (true) {
        P p1, p2, p3;
        cin >> p1.first >> p1.second >> p2.first >> p2.second >> p3.first >> p3.second;
        if (p1 == P{0, 0} and p2 == P{0, 0} and p3 == P{0, 0}) { break; }
        const ld a = dist(p1, p2), b = dist(p2, p3), c = dist(p3, p1), s = (a + b + c) / 2;
        const ld r = sqrt((s - a) * (s - b) * (s - c) / s);
        const ld d = hypot(s - a, r), e = hypot(s - b, r), f = hypot(s - c, r);
        const ld r1 = r / 2 / (s - a) * (s + d - r - e - f), r2 = r / 2 / (s - b) * (s + e - r - d - f), r3 = r / 2 / (s - c) * (s + f - r - d - e);
        cout << fixed << setprecision(15) << r2 << " " << r3 << " " << r1 << endl;
    }
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3240
final_rank: 1

code_snippet: #include <iostream>
#include <math.h>
#include <cmath>
#include <iomanip>
using namespace std;

long double x[3], y[3], l[3], a[3], r[3];
	
bool check() {
	for (int i = 0; i < 3; i++) {
		if (x[i] != 0) {
			return true;
		}
		if (y[i] != 0) {
			return true;
		}
	}
	return false;
}


int main() {
	cout << fixed;
	cout << setprecision(6);

	int tmp;
	bool first = true;
	long double value;
	long double opp, hyp, adj;
	long double dist;
	long double diffx[2], diffy[2];
	long double dirx, diry;

	for (int i = 0; i < 3; i++) {
		cin >> x[i];
		cin >> y[i];
	}

	int itr = 0;
	while (check()) {
		//cout << itr++ << endl;
		for (int i = 0; i < 3; i++) {
			tmp = (i+1) % 3;

			//cout << pow(x[i] - x[tmp], 2) << " " << pow(y[i] - y[tmp], 2) << endl;
			l[i] = sqrtl(pow(x[i] - x[tmp], 2) + pow(y[i] - y[tmp], 2));
		}

		for (int i = 0; i < 3; i++) {
			/*
			hyp = 2*l[i]*l[(i+2)%3];
			adj = pow(l[i], 2) + pow(l[(i+2)%3], 2) - pow(l[(i+1)%3], 2);
			opp = sqrtl(pow(hyp,2)-pow(adj,2));

			a[i] = (hyp - adj) / opp;
			*/

			a[i] = pow(l[i],2) + pow(l[(i+2)%3],2) - pow(l[(i+1)%3],2);
			a[i] /= 2*l[i]*l[(i+2)%3];
			a[i] = acos(a[i]);
			a[i] = tan(a[i]/2);
			//cout << a[i] << endl;
		}


		long double diff = max(l[0],l[2]);
		long double diff2;
		r[0] = 0.1;

		while (diff > 1e-10) {
			r[0] += diff;
			//cout << "START: " << r[0] << endl;

			r[1] = 0.1;
			diff2 = l[0];
			while (diff2 > 1e-10) {
				r[1] += diff2;

				if (r[0]/a[0] + 2*sqrtl(r[0]*r[1]) + r[1]/a[1] > l[0]) {
					r[1] -= diff2;
					diff2 /= 2;
				}
			} 

			r[2] = 0.1;
			diff2 = l[2];
			while (diff2 > 1e-10) {
				r[2] += diff2;

				if (r[0]/a[0] + 2*sqrtl(r[0]*r[2]) + r[2]/a[2] > l[2]) {
					r[2] -= diff2;
					diff2 /= 2;
				}
			} 
			
			value = r[1]/a[1] + 2*sqrtl(r[1]*r[2]) + r[2]/a[2];

			if (value < l[1]) {
				r[0] -= diff;
				diff /= 2;
			} 
		}

		if (first) {
			first = false;
		} else {
			cout << endl;
		}

		cout << r[0];
		for (int i = 1; i < 3; i++) {
			cout << " " << r[i];
		}

		for (int i = 0; i < 3; i++) {
			cin >> x[i];
			cin >> y[i];
		}
	}

	return 0;
}
accuracy: 1
time_ms: 310
memory_kb: 3412
final_rank: 6