Time Limit: 1000MS   Memory Limit: 30000K
Total Submissions: 1458   Accepted: 759

Description

Given a triangle field and a rope of a certain length (Figure-1), you are required to use the rope to enclose a region within the field and make the region as large as possible. 

Input

The input has several sets of test data. Each set is one line containing four numbers separated by a space. The first three indicate the lengths of the edges of the triangle field, and the fourth is the length of the rope. Each of the four numbers have exactly four digits after the decimal point. The line containing four zeros ends the input and should not be processed. You can assume each of the edges are not longer than 100.0000 and the length of the rope is not longer than the perimeter of the field.

Output

Output one line for each case in the following format:

Case i: X

Where i is the case number, and X is the largest area which is rounded to two digits after the decimal point.

Sample Input

12.0000 23.0000 17.0000 40.0000
84.0000 35.0000 91.0000 210.0000
100.0000 100.0000 100.0000 181.3800
0 0 0 0

Sample Output

Case 1: 89.35
Case 2: 1470.00
Case 3: 2618.00

Source

数学问题 计算几何

(物理题?)

画图太麻烦了,随便贴个别处的题解吧233 http://blog.csdn.net/xuechelingxiao/article/details/40707691

没加case傻傻WA了两次

 /*by SilverN*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
const int mxn=;
int read(){
int x=,f=;char ch=getchar();
while(ch<'' || ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>='' && ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
double a,b,c,d;
inline double Sin(double a,double b,double c){
double Cos=(a*a+b*b-c*c)/(*a*b);
return sqrt(-Cos*Cos);
}
double calc(double a,double b,double c,double d){
double Pi=acos(-1.0);
double S=0.5*a*b*Sin(a,b,c);
if(d-(a+b+c)>=){return S;}
double h=S*/(a+b+c);
if(h**Pi>=d){return d*d//Pi;}
double Len=a+b+c;
double T=(Len-d)/(Len-*Pi*h);
return S-S*T*T+(h*T)*(h*T)*Pi;
}
int main(){
int i,j,cas=;
while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d)!=EOF){
if(a== && b== && c== && d==)break;
printf("Case %d: %.2f\n",++cas,calc(a,b,c,d));
}
return ;
}

POJ1927 Area in Triangle的更多相关文章

  1. POJ 1927 Area in Triangle(计算几何)

    Area in Triangle 博客原文地址:http://blog.csdn.net/xuechelingxiao/article/details/40707691 题目大意: 给你一个三角形的三 ...

  2. POJ 1927 Area in Triangle

    Area in Triangle Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1674   Accepted: 821 D ...

  3. hdu 1451 Area in Triangle(计算几何 三角形)

    Given a triangle field and a rope of a certain length (Figure-1), you are required to use the rope t ...

  4. Area in Triangle /// oj10229

    题目大意: 给出三角形的三个顶点 再给一条绳(绳长不超过三角形周长) 求绳子在三角形中能围出的最大面积 题解链接 http://blog.sina.com.cn/s/blog_6a46cc3f0100 ...

  5. POJ 1927 Area in Triangle 题解

    link Description 给出三角形三边长,给出绳长,问绳在三角形内能围成的最大面积.保证绳长 \(\le\) 三角形周长. Solution 首先我们得知道,三角形的内切圆半径就是三角形面积 ...

  6. UVa 11437:Triangle Fun(计算几何综合应用,求直线交点,向量运算,求三角形面积)

    Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see ...

  7. zoj 1010 Area【线段相交问题】

    链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1010 http://acm.hust.edu.cn/vjudge/ ...

  8. Triangle 1.6 (A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator)

    Triangle 一个二维高质量网格(mesh)生成器和Delaunay三角化工具. PSLG(Planar Straight Line Graph)约束Delaunay三角网(CDT)与Delaun ...

  9. [ZJU 1010] Area

    ZOJ Problem Set - 1010 Area Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Jer ...

随机推荐

  1. react的ant design的UI组件库

    PC官网:https://ant.design/ 移动端网址:https://mobile.ant.design/docs/react/introduce-cn antd-mobile :是 Ant ...

  2. 1042: [HAOI2008]硬币购物

    Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 3209  Solved: 2001[Submit][Status][Discuss] Descript ...

  3. 牛客NOIP提高组R1 C保护(主席树)

    题意 题目链接 Sol Orz lyq 我们可以把一支军队(u, v)拆分为两个(u, lca)和(v, lca) 考虑一个点x,什么时候军队对它有贡献,肯定是u或v在他的子树内,且lca在他的子树外 ...

  4. SAP后台JOB的Submit & EVENT JOB

    SM35执行一个后台作业后,想及时停止, 运行SM37后,点击ctr + F1停止活动的作业,系统根本就没反应. 解决方法: 第一步:SM50, 找到,Ty.列为BGD的(Background),然后 ...

  5. 记录一些 FileZillaClient 的基本连接操作

    本地主机:Window 10 FileZilla版本:3.39.0 64位 远程主机:CentOS 6.4 需安装FTP服务 小提示:查看CentOS版本命令 # cat /etc/issue Fil ...

  6. vue.js 发布后路径引用问题

    在发布到iis目录下时候,如果放在网站的根目录下的时候,是不会有什么问题的 但是一旦放在了非根目录的其他文件夹里面,这时候index.html里引用的js和css文件路径都会找不到 错误如下 打开in ...

  7. JZOJ 5459. 【NOIP2017提高A组冲刺11.7】密室

    5459. [NOIP2017提高A组冲刺11.7]密室 (File IO): input:room.in output:room.out Time Limits: 1000 ms  Memory L ...

  8. web前端的环境配置

    1.1.WEB开发的相关知识 WEB,在英语中web即表示网页的意思,它用于表示Internet主机上供外界访问的资源. Internet上供外界访问的Web资源分为: 静态web资源(如html 页 ...

  9. 662. Maximum Width of Binary Tree

    https://leetcode.com/problems/maximum-width-of-binary-tree/description/ /** * Definition for a binar ...

  10. Susan Sontag【苏珊·桑塔格】

    Sunsan Sontag Sunsan Sontag was one of the most noticeable figures in the world of literature. 苏珊·桑塔 ...