https://cn.vjudge.net/contest/251958#problem/G

割线定理(Secant Theorem)指的是从圆外一点引圆的两条割线,这一点到每条割线与圆交点的距离的积相等。

文字表达:从圆外一点引圆的两条割线,这一点到每条割线与圆交点的距离的积相等。

数学语言:从圆外一点L引两条割线与圆分别交于A.B.C.D 则有 LA·LB=LC·LD=LT²。

几何语言:∵割线LDC和LBA交于圆O于ABCD点

∴LA·LB=LC·LD=LT²

如图所示。(LT为切线)

这个题其实并不一定需要用到割线定理,因为圆的内切四边形的对角和为180,所以角oda = 角cbo,所以三角形oda相似于三角形obc。所以写出各边之比即可求解。。。

Ran Mouri and Sonoko Suzuki are preparing for the final exams. They decided to study mathematics as it is the hardest subject for them. While they are solving mathematical problems, they faced troubles with some questions, including the following question:

You are given a drawing for a sensor and some measurements about it. You have to find the rest of measurements. Sensor's design is as follow:

The data you have is the length of , the length of , the area of  oda, and the area of  obc. Your task is to calculate x and y, where x is the length of  and y is the length of .

Can you help Ran and Sonoko Suzuki by solving this question?

Input

The first line contains an integer T (1 ≤ T ≤ 2 × 105), in which T is the number of test cases.

Then T lines follow, each line contains four integers klm, and n (1 ≤ k, l, m, n ≤ 1012), in which k is the length of l is the length of m is the area of  oda, and n is the area of  obc.

Output

For each test case, print a single line containing two numbers x and y, where x is the length of  and y is the length of . Your output will be considered correct if the absolute or relative error of every number in your output does not exceed 10 - 6.

Example

Input

1
18 16 72 288

Output

20 14
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;int main()
{int T;double k, l, m, n;double x, y;scanf("%d", &T);while(T--){scanf("%lf%lf%lf%lf", &k, &l, &m, &n);x = k*1.0*(sqrt(n/m));//函数原型为double sqrt(double);x = x - l;y = l*1.0*(sqrt(n/m));y = y - k;printf("%lf %lf\n", x, y);}return 0;
}

Preparing for Exams(割线定理)相关推荐

  1. 什么是方向图乘积定理_课本上没有,但十分好用的初中数学定理公式

    平行四边形(实用度: ★ ★ ) 两边长为a和b,两对角线长为m和n,可以拿这个公式和托勒密定理对比记忆. 三角形 A.勾股数(实用度: ★ ★ ) 常见的最简勾股数有: 3.4.5 5.12.13 ...

  2. 数学定理可以这样证明

    理科作为很多科学研究的基础学科,相信大家也都有一个印象,就是一定要理解.比如数学,初中的数学公式很多都是作为定理教给学生的,但是碍于教学工具的不足,很多数学老师也不会仔细的给学生们多讲.学生们最多只是 ...

  3. 【计几】圆的一些定理

    文章目录 笛卡尔定理 圆冥定理 极点 & 极线 题目 HDU 6158 笛卡尔定理 + 韦达定理 [牛客 contest 553 Chino with Geometry](https://ac ...

  4. 过椭圆外一点引两条切线方程_椭圆的一些结论汇总

    1. 布利安桑定理:椭圆外切六边形的对角线连线共点. 2. 帕斯卡定理:椭圆内接六边形三对边的交点共线. 3. 割线定理:从椭圆外一点 向椭圆引两条割线,交于 四点,对角线交点为Q, 的连线与椭圆交于 ...

  5. A Collection of 100+ Writing Task 2 Essays for IELTS

    EDITION 2019 A Collection of 100+ Writing Task 2 Essays IELTS ESSAYS FROM EXAMINERS VERSION 3.0 OREM ...

  6. 乘方运算中的“次幂”和“次方”有什么区别?

    一个数的"N次幂"和"N次方"在意义上有什么区别?为什么要用不同的名称? 答1: 从数学角度来说,没有什么大的区别.意义都是一致的,都表示N个相同数的连乘. 从 ...

  7. 自我接纳_接纳预测因子

    自我接纳 现实世界中的数据科学 (Data Science in the Real World) Students are often worried and unaware about their ...

  8. oracle java认证_如何通过Oracle的Java认证-开发人员实用指南

    oracle java认证 by javinpaul 由javinpaul 如何通过Oracle的Java认证-开发人员实用指南 (How to Pass Oracle's Java Certific ...

  9. E.04.08 They Survived Taiwan’s Train Crash. Their Loved Ones Did Not.

    2021.04.08 文章目录 [课程导读] [英文原文] [外刊原文] [课程导读] 4月2日,台铁太鲁阁号列车,行至花莲大清水隧道时发生严重脱轨事故.截至目前,车上350余名乘客中,死亡人数达到5 ...

  10. js求两圆交点_如何求两个圆的交点坐标,请举例

    展开全部 将两个圆62616964757a686964616fe4b893e5b19e31333431363563的方程相减,就消掉了x²,y²项,剩下一个关于x, y的一次方程,可解得y=kx+b. ...

最新文章

  1. html5 直接获取当前位置,HTML5调用百度地图API获取当前位置并直接导航目的地的方法...
  2. 解决导入第三方图片JS出现403问题
  3. A840S黑砖修复过程(2013-05-22修改)
  4. python调用第三方软件发信代码_【IT专家】python调用第三方邮件接口
  5. python aes加密 cbc_Python实现AES的CBC模式加密和解密过程详解 和 chr() 函数 和 s[a:b:c] 和函数lambda...
  6. MarkDown语法-使用博客园的markDown编辑
  7. vue下拉框值改变事件_vue和element ui 下拉框select的change事件
  8. 在 vscode 中使用 Git :拉取、提交、克隆
  9. Mac 远程命令工具
  10. python内存的回收机制_python的内存管理和垃圾回收机制详解
  11. JSON格式输出Struts2
  12. python类封装成dl_第7.9节 案例详解:Python类封装
  13. json react 展示工具_如何基于jsoneditor二次封装一个可实时预览的json编辑器组件?(react版)...
  14. 电视机与计算机共享,使用MiShare实现一键共享电脑中的图片视频到电视机上观看...
  15. Linux文件权限与目录配置
  16. UVA11134 Fabled Rooks
  17. JZ17 树的子结构
  18. 如何产生创业想法(3 个框架)
  19. DayDayUp:我是CSDN开发者生态联盟成员“一个处女座的程序猿”:渡己是一种能力,渡人是一种格局
  20. 洛谷 P2181对角线——排列组合

热门文章

  1. [打新技巧]打新股产品跷跷板定律
  2. 记录一次 AGP 调研过程中的思考,我从一个事故搞出了一个故事!
  3. matlab定义struck,Peter Struck
  4. 【视频检测】Flow-Guided Feature Aggregation for Video Object Detection
  5. 重磅出炉!KCon 黑客大会 2019 演讲议题正式公布
  6. 桌面图标有阴影去除方法
  7. 五、网络整理BAT脚本——字符串常规操作
  8. Percent百分比布局用法
  9. ICM TSCC视频格式的播放
  10. 复制文件夹 omitting directory