|
||||||||||
Can't be easierTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1203 Accepted Submission(s): 539 Problem Description I'm sure this problem will fit you as long as you didn't sleep in your High School Math classes. Yes,it just need a little math knowledge and I know girls are always smarter than we expeted. So don't hesitate any more,come and AC it! Tell you three point A,B,C in a 2-D plain,then a line L with a slope K pass through C,you are going to find a point P on L,that makes |AP| + |PB| minimal. Input The first line contain a t. Then t cases followed,each case has two parts,the first part is a real number K,indicating the slope,and the second part are three pairs of integers Ax,Ay,Bx,By,Cx,Cy(0 <=|Ax|,|Ay|,|Bx|,|By|,|Cx|,|Cy| <= 10000 ). Output Just out put the minimal |AP| + |PB|(accurate to two places of decimals ). Sample Input
Sample Output
Author Teddy Source | ||||||||||
|