F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Triangle

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1    Accepted Submission(s): 1


Problem Description
This is a simple question, give you a triangle, please divide the triangle into two parts with a segment.
These two parts should have the same area, and the segment should be as short as possible. Please calculate the length of the segment.
 

Input
The first line of the input is the number T(T<=100), which is the number of cases followed.
For each test case, the only line contains space-separated integers x1, y1, x2, y2, x3, y3,the coordinates of triangle endpoint.
The absolute value of all the coordinates will not be more than 109.
 

Output
For each test case, output only one line, containing the length of segment only. Your answer should be rounded to 4 digits after the decimal point.
 

Sample Input
1 0 0 10 0 0 10
 

Sample Output
6.4359
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-03-29 19:19:06, Gzip enabled