程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> each- Cant be easier

each- Cant be easier

編輯:編程解疑
Cant be easier

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

1 2.55 8467 6334 6500 9169 5724 1478

Sample Output

3450.55

最佳回答:


http://www.68idc.cn/help/buildlang/ask/20150320287956.html

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved