#include #include #include #include #include #include //#include int main() { double l_ax, l_ay; double l_bx, l_by; double l_cx, l_cy; double l_amidx, l_amidy, l_bmidx, l_bmidy, l_cmidx, l_cmidy; double l_alength, l_blength, l_clength; double l_amidlength, l_bmidlength, l_cmidlength; double l_ashort, l_bshort, l_cshort; std::cin >> l_ax >> l_ay; std::cin >> l_bx >> l_by; std::cin >> l_cx >> l_cy; // midpoints l_amidx = (l_bx - l_cx) / 2 + l_cx; l_amidy = (l_by - l_cy) / 2 + l_cy; l_bmidx = (l_cx - l_ax) / 2 + l_ax; l_bmidy = (l_cy - l_ay) / 2 + l_ay; l_cmidx = (l_bx - l_ax) / 2 + l_ax; l_cmidy = (l_by - l_ay) / 2 + l_ay; // lengths l_alength = sqrt(pow(l_bx - l_cx, 2) + pow(l_by - l_cy, 2)); l_blength = sqrt(pow(l_cx - l_ax, 2) + pow(l_cy - l_ay, 2)); l_clength = sqrt(pow(l_bx - l_ax, 2) + pow(l_by - l_ay, 2)); l_amidlength = sqrt(pow(l_amidx - l_ax, 2) + pow(l_amidy - l_ay, 2)); l_bmidlength = sqrt(pow(l_bmidx - l_bx, 2) + pow(l_bmidy - l_by, 2)); l_cmidlength = sqrt(pow(l_cmidx - l_cx, 2) + pow(l_cmidy - l_cy, 2)); l_ashort = l_amidlength - (l_alength / 2); l_bshort = l_bmidlength - (l_blength / 2); l_cshort = l_cmidlength - (l_clength / 2); // test output double l_result = l_cshort; if (l_ashort <= l_bshort) { if (l_ashort <= l_cshort) l_result = l_ashort; } else if (l_bshort <= l_cshort) { l_result = l_bshort; } std::cout << std::fixed << std::setprecision(9) << l_result << '\n'; std::cout << '\n'; //std::cout << l_ashort << '\n'; //std::cout << l_bshort << '\n'; //std::cout << l_cshort << '\n'; }