#include #include using namespace std; double d (pair p1,pair p2,pair p3) { double ox = (p1.first + p1.second)/2, oy = (p2.first + p2.second)/2; double r = ((pow(p2.second - p1.second, 2) + pow(p2.first - p1.first, 2)))/4; double xp1 = sqrt(r/(pow(((p3.second - oy)/(p3.first - ox)), 2) + 1)) + ox; double xp2 = -sqrt(r/(pow(((p3.second - oy)/(p3.first - ox)), 2) + 1)) + ox; double yp1 = ((p3.second - oy)/(p3.first-ox))*(xp2-ox) + oy; double yp2 = ((p3.second - oy)/(p3.first-ox))*(xp1-ox) + oy; double d1 = sqrt(pow(p3.second - yp1, 2) + pow(p3.first - xp2, 2)); double d2 = sqrt(pow(p3.second - yp2, 2) + pow(p3.first - xp1, 2)); return min(d1, d2); } int main() { double x1, y1; double x2, y2; double x3, y3; cin >> x1 >> y1; cin >> x2 >> y2; cin >> x3 >> y3; double mind1 = d({x1, y1}, {x2, y2}, {x3, y3}); double mind2 = d({x3, y3}, {x2, y2}, {x1, y1}); double mind3 = d({x2, y2}, {x1, y1}, {x3, y3}); double mind4 = d({x1, y1}, {x3, y3}, {x2, y2}); double mind5 = d({x2, y2}, {x3, y3}, {x1, y1}); double mind6 = d({x3, y3}, {x1, y1}, {x2, y2}); double mind12 = min(mind1, mind2); double mind34 = min(mind3, mind4); double mind56 = min(mind5, mind6); double minDs = min(mind12, min(mind34, mind56)); cout << minDs << "\n"; return 0; }