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 & ...
随机推荐
- python学习(二):基本数据类型:整型,字符型
整型: type():显示数据类型 # 整型,int # python3里,不管数字有多大,都是int类型 # python2里,有大小区分,长整型:long int a = " print ...
- 紫书 习题8-19 UVa 1312 (枚举技巧)
这道题参考了https://www.cnblogs.com/20143605--pcx/p/4889518.html 这道题就是枚举矩形的宽, 然后从宽再来枚举高. 具体是这样的, 先把所有点的高度已 ...
- 【codeforces 67A】Partial Teacher
[题目链接]:http://codeforces.com/problemset/problem/67/A [题意] 给一个长度为n-1的字符串; 每个字符串是'L','R','='这3种字符中的一个; ...
- What's the difference between returning void and returning a Task?
http://stackoverflow.com/questions/8043296/whats-the-difference-between-returning-void-and-returning ...
- 如何启动和关闭MySQL?(四)
分为: 图形化 命令行 方法一:在“计算机”的图标上右键,然后选择“管理”,双击“服务和应用程序”,然后选择“服务”,找到“MySQL”这个服务,然后点击“右键”,就可以进行“停止”和“重新启动”的操 ...
- Hadoop的目录结构
- HBase的体系结构
- HBase框架基础(一)
* HBase框架基础(一) 官方网址:http://hbase.apache.org/ * HBase是什么妖怪? 要解释HBase,我们就先说一说经常接触到的RDBMS,即关系型数据库: ** m ...
- 基于jquery 的find()函数和children()函数的区别
element.find(selector) 返回匹配element集合中每个元素的后代,参数selector是必须的,可以通过选择器对元素进行过滤,筛选出符合条件的元素.如果想选中所有的后代元素, ...
- Spring MVC模式示例(采用解耦控制器+校验器)
Product package com.mstf.bean; import java.io.Serializable; /** * Product类,封装了一些信息,包含三个属性 * @author ...