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

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

  1. acdream.18.KIDx's Triangle(数学推导)

    KIDx's Triangle Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Sub ...

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

    上篇记录了一些决策树算法,这篇是借OC-SVM填回SMO在SVM中的数学推导这个坑. 参考文献: http://research.microsoft.com/pubs/69644/tr-98-14.p ...

  3. 关于不同进制数之间转换的数学推导【Written By KillerLegend】

    关于不同进制数之间转换的数学推导 涉及范围:正整数范围内二进制(Binary),八进制(Octonary),十进制(Decimal),十六进制(hexadecimal)之间的转换 数的进制有多种,比如 ...

  4. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

  5. 『sumdiv 数学推导 分治』

    sumdiv(POJ 1845) Description 给定两个自然数A和B,S为A^B的所有正整数约数和,编程输出S mod 9901的结果. Input Format 只有一行,两个用空格隔开的 ...

  6. LDA-线性判别分析(二)Two-classes 情形的数学推导

    本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...

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

    Given a positive integer n, break it into the sum of at least two positive integers and maximize the ...

  8. [hdu5307] He is Flying [FFT+数学推导]

    题面 传送门 思路 看到这道题,我的第一想法是前缀和瞎搞,说不定能$O\left(n\right)$? 事实证明我的确是瞎扯...... 题目中的提示 这道题的数据中告诉了我们: $sum\left( ...

  9. ZOJ3329(数学推导+期望递推)

    要点: 1.期望的套路,要求n以上的期望,则设dp[i]为i分距离终点的期望步数,则终点dp值为0,答案是dp[0]. 2.此题主要在于数学推导,一方面是要写出dp[i] = 什么,虽然一大串但是思维 ...

随机推荐

  1. 标准I/O

    在程序运行时,会默认为我们打开三个流:标准输入流.标准输出流.标准出错流. 标准输入流一般对应我们的键盘 标准输出流一般对应显示器 标准出错流一般也对应显示器 1.标准输入流 在标准I/O中,java ...

  2. 【C#】依赖于SharpZipLib的Zip压缩工具类

    上班第二天下班,课外作业,实现一个ZIP压缩的工具类.本来想用Package,但是写完了才发现不能解压其他工具压缩的zip包,比较麻烦,因此本工具类依赖了第三方的库(SharpZipLib  vers ...

  3. 领域事件DomainEvents

    静态类DomainEvents: public static class DomainEvents { [ThreadStatic] private static List<Delegate&g ...

  4. hdu1520 树形dp

    树形dp入门,在树上进行dp. 状态转移方程: dp[i][0] = max(dp[j][0], dp[j][1]);//i为j的上司 并且i不来 dp[i][1] = dp[j][0];//i来了 ...

  5. '$.browser.msie' 为空或不是对象

    最近决定整改一下jquery 的版本,于是就将 jquery 从 1.7.2 升级到了 1.9.1 结果就发现原有的插件报错了. '$.browser.msie' 为空或不是对象,这个是jQuery错 ...

  6. Tomcat 使用说明

    Tomcat下有7个目录,分别是bin,conf,lib,logs,temp,webapps,work 目录 Tomcat根目录在tomcat中叫<CATALINA_HOME> 1.< ...

  7. strcmp的实现

    注意,*str1++和*str2++最好不要写在while判断里,否则需要在return前再*str1-1,和*str2-1. int strcmp(const char *str1,const ch ...

  8. android中Handle类的用法

    android中Handle类的用法 当我们在处理下载或是其他需要长时间执行的任务时,如果直接把处理函数放Activity的OnCreate或是OnStart中,会导致执行过程中整个Activity无 ...

  9. javaIO(二)

    在程序中所有的数据都是以流的方式进行传输或保存的,程序需要数据时要使用输入流读取数据,而当程序需要将一些数据保存起来时,就要使用输出流. 在java.io包中流的操作主要有字节流.字符流两大类,两类都 ...

  10. linux系统编程----统计一个目录下的普通文件个数

    主要是为了统计linux系统下一个指定目录下面的普通文件个数,运用目录操作的一些函数,配合递归调用来实现该功能. 首先介绍一下函数原型: 打开一个空目录                    DIR ...