边之比的平方=面积之比
来源:互联网 发布:java的框架 编辑:程序博客网 时间:2024/05/01 15:34
Description
See the picture below.
You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.
Input
Input starts with an integer T (≤ 25), denoting the number of test cases.
Each case begins with four real numbers denoting AB, AC, BC and the ratio of ADE and BDEC (ADE / BDEC). You can safely assume that the given triangle is a valid triangle with positive area.
Output
For each case of input you have to print the case number and AD. Errors less than 10-6 will be ignored.
Sample Input
4
100 100 100 2
10 12 14 1
7 8 9 10
8.134 9.098 7.123 5.10
Sample Output
Case 1: 81.6496580
Case 2: 7.07106781
Case 3: 6.6742381247
See the picture below.
You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.
Input
Input starts with an integer T (≤ 25), denoting the number of test cases.
Each case begins with four real numbers denoting AB, AC, BC and the ratio of ADE and BDEC (ADE / BDEC). You can safely assume that the given triangle is a valid triangle with positive area.
Output
For each case of input you have to print the case number and AD. Errors less than 10-6 will be ignored.
Sample Input
4
100 100 100 2
10 12 14 1
7 8 9 10
8.134 9.098 7.123 5.10
Sample Output
Case 1: 81.6496580
Case 2: 7.07106781
Case 3: 6.6742381247
Case 4: 7.437454786
#include<cstdio>#include<math.h>#include<algorithm>using namespace std;int main(){int t;int cont=0;double a,b,c,bi;scanf("%d",&t);while(t--){scanf("%lf%lf%lf%lf",&a,&b,&c,&bi);double s=a*pow(bi/(bi+1.0),0.5);printf("Case %d: %.9lf\n",++cont,s);} return 0;}
0 0
- 边之比的平方=面积之比
- lightoj1043(相似三角形面积自比等于对应边比的平方)
- light oj 1043(数学 + 三角形面积与边之比)
- zoj 1439 Area Ratio 计算三角形内接圆面积和外接圆面积之比
- 长度、面积、体积的相似比原理
- MonkeyRunner之手机屏幕截图的比对
- 斯比亚之名
- 优比仕之旅
- 逗比学树莓派之GPIO
- mdx常用计算之环比与同期比
- 1:100的财富和理想之比
- 星之卡比的blog转移至...
- 设计之痛比女人还麻烦的IE浏览器
- 汤因比的《历史研究》所感之二
- 今日温故知新之比大小注意的地方
- 比float更好的网页布局之inline-block
- 版本比对之CFBundleShortVersionString与CFBundleVersion的区别
- 自定义布局之宽高比布局的实现
- java多线程
- 【Light-oj】-1138 - Trailing Zeroes (III)(二分,数学)
- 98. Validate Binary Search Tree
- GitHub常用开源框架
- c++模板的问题解析-问题2
- 边之比的平方=面积之比
- Spring 快速学习笔记
- JAVA深入研究——Method的Invoke方法。
- 分享一下书签
- Linux感悟-前言
- 使用javamail发送邮件
- 小鸡腿U T8 CERC2015
- [CF]Ilya and Queries
- hrbust 1759 Lawnmower【思维题】