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.
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 ).
Just out put the minimal |AP| + |PB|(accurate to two places of decimals ).