lightoj--1043-- Triangle Partitioning (水题)
Time Limit: 500MS | Memory Limit: 32768KB | 64bit IO Format: %lld & %llu |
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
Case 4: 7.437454786
Source
现在给出了AB,AC,BC以及三角形与梯形面积比值,求AD
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
int t;
int K=1;
scanf("%d",&t);
while(t--)
{
double a,b,c,k;
scanf("%lf%lf%lf%lf",&a,&b,&c,&k);
double ad=a*sqrt(k/(1+k));
printf("Case %d: %.6lf\n",K++,ad);
}
return 0;
}
lightoj--1043-- Triangle Partitioning (水题)的更多相关文章
- Lightoj 1043 - Triangle Partitioning【二分】
题目链接:http://lightoj.com/volume_showproblem.php? problem=1043 题意:一个三角形ABC,DE//BC.已知三角形ADE和四边形BDEC的面积的 ...
- 二分--1043 - Triangle Partitioning
1043 - Triangle Partitioning PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: ...
- 1043 - Triangle Partitioning(数学)
1043 - Triangle Partitioning PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit ...
- LightOJ 1248 Dice (III) (水题,期望DP)
题意:给出一个n面的色子,问看到每个面的投掷次数期望是多少. 析:这个题很水啊,就是他解释样例解释的太...我鄙视他,,,,, dp[i] 表示 已经看到 i 面的期望是多少,然后两种选择一种是看到新 ...
- lightoj 1020 (博弈水题)
lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个 ...
- LightOJ 1023 Discovering Permutations 水题
http://www.lightoj.com/volume_showproblem.php?problem=1023 题意:26字母全排列 思路:用next_permutation或者思维想一下都可以 ...
- nyoj--18--The Triangle(dp水题)
The Triangle 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure ...
- 二分--LIGHTOJ 1088查找区间(水题)
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const ...
- LightOJ 1214 Large Division 水题
java有大数模板 import java.util.Scanner; import java.math.*; public class Main { public static void main( ...
- LightOJ 1220 Mysterious Bacteria 水题
暴力就行了,找出素因子,正的最多是30,然后负的最多是31(这一点wa了一次) #include <cstdio> #include <iostream> #include & ...
随机推荐
- vue:element-ui时间选择器限制只能点不能输入
原文链接:点我 <el-form-item label="门店成立日期" prop="storeSetupDate"> <template&g ...
- [NOIP2012提高组]疫情控制
题目:洛谷P1084.codevs1218.Vijos P1783. 题目大意:有一棵n个节点的,根为1的带权树和m支军队.每支军队可以在一个点上停下,那么从1开始就不能经过这个点了.现在有m支军队已 ...
- Linux一些简单命令
1.安装gvim:sudo apt-get install vim-gtk vim和gvim相同,只是后者比前者多了一个界面,此界面可以用来保存.新建.查找等. 三种模式,insert(i),norm ...
- 【CS round 34】Minimize Max Diff
[题目链接]:https://csacademy.com/contest/round-34/task/minimize-max-diff/ [题意] 给你n个数字; 数组按顺序不下降; 让你删掉k个数 ...
- Ubuntu设置显示桌面快捷键
Ubuntu设置显示桌面快捷键 直接在系统设置中没有效果, 学习了:http://www.cnblogs.com/pluse/p/5286585.html 需要进行安装compizconfig,然后在 ...
- 转:iOS app支付宝接口调用的一点总结(补充支付宝SDK&Demo下载地址)
iosiOSIOS文档服务器测试电话 由于app内需要用到支付功能,选择了当前最流行的支付宝进行支付.在进行内嵌支付宝功能开发时,被它狠狠的耍了一把. 根据支付宝开发文档,参考demo代码.将相关支付 ...
- 自定义标签 Unable to find setter method for attribute
变量的首字母不能大写 http://blog.csdn.net/looksun/article/details/7690601
- nyoj--1233--差值(贪心模拟+大数)
差值 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 输入一个整数数组,将它们连接起来排成一个数,找出能排出的所有数字中最大,最小的两个,输出两个数的差值.例如输入数组{ ...
- windows 快捷调用
win + x:系统常用管理工具: win + r,或者按下 windows 键,在输入框中输入: services.msc:服务管理: diskmgmt.msc:磁盘管理: devmgmt.msc: ...
- django 笔记7 多对多
多对多 方法一 :双外键关联 自定义关系表 自定义 class Host(models.Model): nid = models.AutoField(primary_key=True) hostnam ...