Area in Triangle
1000ms 32768K
描述:
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.
输入:
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 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.
三角形的区域
描述:
给一个三角形的场地和一根一定长度的绳子(数字-1),你被要求用这根绳子去围住一个区域并且使这个区域尽可能大。
输入:
输入有一些组的数据。每组一行包括四个数字,中间用空格分开。前三个数字表示三角形场地的三边长,并且第四个数字有准确的四位小数。
一行由四个0的数据用来结束输入并且不应该被处理。你可以假设每边都没有100.0000长并且绳子的长度没有土地的周长长。
输出:
对于每组数据按以下格式输出一行:
Case i: X
在这里i是组数的编号,并且X是最大的面积,它四舍五入小数点后两位。