LIGHTOJ-1043 -Triangle Partitioning
来源:互联网 发布:java环境配置 编辑:程序博客网 时间:2024/06/04 05:41
1043 - Triangle Partitioning
PDF (English)StatisticsForum
Time Limit: 0.5 second(s)Memory Limit: 32 MB
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
Output for Sample Input
4
100 100 100 2
10 12 14 1
7 8 9 10
8.134 9.098 7.123 5.10
Case 1: 81.6496580
Case 2: 7.07106781
Case 3: 6.6742381247
Case 4: 7.437454786
数学题,用相似三角形解出AD长度解出公式即可
#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;int main(){int m,n,i,j,cot=1;double a,b,c,d,r;scanf("%d",&m);while(m--){scanf("%lf%lf%lf%lf",&a,&b,&c,&d);r=sqrt(d/(d+1))*a;printf("Case %d: %.7lf\n",cot++,r);}return 0; }
0 0
- LightOJ 1043 Triangle Partitioning
- LightOJ 1043 - Triangle Partitioning
- LIGHTOJ-1043 -Triangle Partitioning
- lightoj 1043 - Triangle Partitioning
- LightOJ 1043 - Triangle Partitioning
- Lightoj 1043 (Triangle Partitioning)
- LightOJ 1043 Triangle Partitioning
- 【LightOJ 1043 Triangle Partitioning】
- Lightoj 1043 Triangle Partitioning | 二分
- Lightoj 1043 - Triangle Partitioning【二分】
- LightOJ 1043 - Triangle Partitioning【数学】
- lightoj 1043 - Triangle Partitioning 【水题】
- lightoj 1043 - Triangle Partitioning 公式
- lightoj 1043 - Triangle Partitioning (数学)
- LightOJ 1043Triangle Partitioning(数学)
- LightOJ 1043 Triangle Partitioning(数学公式)
- lightoj--1043--Triangle Partitioning(水题)
- LightOJ 1043 - Triangle Partitioning (简单数学)
- TCMalloc小记
- nyoj99(欧拉路)
- OAF学习笔记-不基于EO的数据处理
- C 标准库 strstr 函数的实现
- Idea 15 64位安装
- LIGHTOJ-1043 -Triangle Partitioning
- POJ3295——Tautology
- I/O流性能比拼
- HDU 4325 Flowers(线段树+离散化)
- Android - User Interface
- 【OpenCV】边缘检测:梯度,sobel算子的理解
- ASCII码对应表chr(9)、chr(10)、chr(13)、chr(32)、chr(34)、chr(39)、
- Introduction to Recommender System 之 Module 4 User-User Collaborative Filtering
- 南大软院大神养成计划第二十一天