杭赛.Triangle(数学推导)

Triangle

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

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

最短分割线定理:

Z^2 = |a | * |b| - a * b

时间: 2024-11-05 11:26:43

杭赛.Triangle(数学推导)的相关文章

acdream.18.KIDx&#39;s Triangle(数学推导)

KIDx's Triangle Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Statistic Next Problem Problem Description One day, KIDx solved a math problem for middle students in seconds! And than he created this problem. N

HDU1719 Friend (数学推导)

friend numbers = 2^x + 3^y -1 1 #include<stdio.h> 2 int main() 3 { 4 __int64 a; 5 while(scanf("%I64d",&a)!=EOF) 6 { 7 if(!a) 8 { 9 printf("NO!\n"); 10 continue; 11 } 12 a+=1; 13 while(a%2==0||a%3==0) 14 { 15 if(a%2==0) a/=2;

HDU 5073 Galaxy(Anshan 2014)(数学推导,贪婪)

Galaxy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 556    Accepted Submission(s): 127 Special Judge Problem Description Good news for us: to release the financial pressure, the government

leetcode 343. Integer Break(dp或数学推导)

Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, return 36 (10 = 3 +

借One-Class-SVM回顾SMO在SVM中的数学推导--记录毕业论文5

上篇记录了一些决策树算法,这篇是借OC-SVM填回SMO在SVM中的数学推导这个坑. 参考文献: http://research.microsoft.com/pubs/69644/tr-98-14.pdf https://inst.eecs.berkeley.edu/~ee227a/fa10/login/l_dual_strong.html https://inst.eecs.berkeley.edu/~ee127a/book/login/l_sdual_slater.html http://w

HDU 5073 Galaxy(Anshan 2014)(数学推导,贪心)

Galaxy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 556    Accepted Submission(s): 127 Special Judge Problem Description Good news for us: to release the financial pressure, the government

最大熵模型中的数学推导

最大熵模型中的数学推导 查看原文,点击这里 0 引言 写完SVM之后,一直想继续写机器学习的系列,无奈一直时间不稳定且对各个模型算法的理解尚不够,所以导致迟迟未动笔.无独有偶,重写KMP得益于今年4月个人组织的算法班,而动笔继续写这个机器学习系列,正得益于今年10月组织的机器学习班. 10月26日机器学习班第6次课,身为讲师之一的邹博讲最大熵模型,他从熵的概念,讲到为何要最大熵.最大熵的推导,以及求解参数的IIS方法,整个过程讲得非常流畅,特别是其中的数学推导.晚上我把他的PPT 在微博上公开分

时域和频域变换之---傅里叶级数的数学推导

废话不多说先列提纲: 0.概述-需求分析-功能描述-受限和缺点改进+知识点预备 1.泰勒级数和傅里叶级数的本质区别,泰勒展开 2.  函数投影和向量正交 3.两个不变函数求导是本身e^x,sinx,cosx也是为什么要傅里叶转换的原因! 4.傅里叶技术推到过程 5.附录参考资料 0.有些时候,尤其是在图像处理中,矩阵运算数据量太大,特征提取量多,此时可以通过时域转频域来减少计算量,而且此转换不会损失数据完整性. 时域转频域的方法有周期函数用傅里叶技术,非周期函数(没有间断点的函数)用傅里叶转换,

Codeforces Round #360 (Div. 2) D 数学推导 E dp

Codeforces Round #360 (Div. 2) A  == B  水,但记一下: 第 n 个长度为偶数的回文数是  n+reverse(n). C    dfs 01染色,水 #include<bits/stdc++.h> using namespace std; #pragma comment(linker, "/STACK:102400000,102400000") #define rep(i,a,b) for (int i=a; i<=b; ++i