博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Lightoj1043--Triangle Partitioning(水数学)
阅读量:7049 次
发布时间:2019-06-28

本文共 1156 字,大约阅读时间需要 3 分钟。

Triangle Partitioning
       
Time Limit: 0.5 second(s) Memory Limit: 32 MB

See the picture below.

 

You are given ABAC and BCDE 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

 

简直就是大神们秀智商的天堂。

#include 
#include
int main(){ int t, Tim = 1; scanf("%d", &t); while(t--){ double a, b, c, d; scanf("%lf%lf%lf%lf", &a, &b, &c, &d); double temp = sqrt(d/(d+1)); printf("Case %d: %.6lf\n", Tim++, temp*a); } return 0;}

 

转载于:https://www.cnblogs.com/soTired/p/5024258.html

你可能感兴趣的文章
深度学习主机环境配置: Ubuntu16.04+GeForce GTX 1080+TensorFlow
查看>>
linux 抓包 tcpdump 简单应用
查看>>
mongodb官网文档阅读笔记:与写性能相关的几个因素
查看>>
PHP处理时间格式
查看>>
BestCoder Round #11 (Div. 2)
查看>>
JAVA入门[20]-Spring Data JPA简单示例
查看>>
Python: The _imagingft C module is not installed错误的解决
查看>>
HTTP请求报文和HTTP响应报文
查看>>
第3课 - 初识程序的灵魂
查看>>
WordPress插件扫描工具plecost
查看>>
【PDF】Java操作PDF之iText超入门
查看>>
PHP:第五章——字符串过滤函数
查看>>
Spring中ApplicationContextAware的用法
查看>>
flask的session解读及flask_login登录过程研究
查看>>
ElasticSearch单机多实例环境部署
查看>>
python 练习
查看>>
Centos 安装 nload
查看>>
SQL 通配符及其使用
查看>>
Mysql错误:Ignoring query to other database解决方法
查看>>
phantomjs 抓取房产信息
查看>>