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. 第30题:LeetCode155. Min Stack最小栈

    设计一个支持 push,pop,top 操作,并能在O(1)时间内检索到最小元素的栈. push(x) -- 将元素 x 推入栈中. pop() -- 删除栈顶的元素. top() -- 获取栈顶元素 ...

  2. JZOJ 3493. 【NOIP2013模拟联考13】三角形

    3493. [NOIP2013模拟联考13]三角形(triangle) (File IO): input:triangle.in output:triangle.out Time Limits: 10 ...

  3. Thinkphp 支付宝插件的引入 和调用

    本文版权归本宝宝所有 未得允许不得转载 下载地址传送门 https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.twLYka&am ...

  4. 使用jieba和wordcloud进行中文分词并生成《悲伤逆流成河》词云

    因为词云有利于体现文本信息,所以我就将那天无聊时爬取的<悲伤逆流成河>的评论处理了一下,生成了词云. 关于爬取影评的爬虫大概长这个样子(实际上是没有爬完的): #!/usr/bin/env ...

  5. 笔记-python-selenium,phantomjs

    笔记-python-selenium,phantomjs 1.      简介 1.1.    selenium selenium是一款自动化测试工具,支持多种语言 为什么爬虫要使用selenium呢 ...

  6. 异步消息处理机制,UI更新

    UI只能在主线程中完成更新,在子线程中更新UI报错如下 Only the original thread that created a view hierarchy can touch its vie ...

  7. pyautogui 模块学习

    在日常实施中,我们用控件对大部分的网页和客户端都能进行拾取操作.但是仍有一小部分的应用无法进行操作.这里我常用到 pyautogui 这个模块.下面做个分享. Python 的 pyautogui 模 ...

  8. TCP/IP网络编程之网络编程和套接字

    网络编程和套接字 网络编程又称为套接字编程,就是编写一段程序,使得两台连网的计算机彼此之间可以交换数据.那么,这两台计算机用什么传输数据呢?首先,需要物理连接,将一台台独立的计算机通过物理线路连接在一 ...

  9. Django 四——ModelForm用法

    内容概要: 1.新增数据库表中数据 2.更新数据库表中数据 Django的ModelForm Django中内置了Form和Model两个类,有时候页面的表单form类与Model类是一一对应,因此分 ...

  10. Robotium接入到Jenkins持续集成自动化测试

    6.3 将测试用例接入到Jenkins 由于我是自己学习的手机自动化测试,没有实际投入到工作中使用,jenkins的接入也没有具体操作,现摘抄一下网页:http://www.tuicool.com/a ...