标签:
Description
There is an beautiful ellipse whose curve equation is:
There is a parallelogram named P inscribed in this ellipse. At the same time, the parallelogram P is externally tangent to some circle center at the origin (0,0).
Now your task is to output the maximum and minimum area of P among all possible conditions.
Input
The input consists of multiple test cases.
For each test case, there is exactly one line consists of two integers a and b. 0 < b <= a <= 109
Output
For each test case, output one line of two one-space splited numbers: the maximum area and the minimum area. The absolute or relative error of the coordinates should be no more than 10-6.
Sample Input
1 1
Sample Output
2 2
简单题意:
给出椭圆方程,然后求内接平行四边形,但是这个平行四边行必须内接与一个圆,
求符合条件的最大最小面积。
简单思路:
由条件可以推出,最大最小为,内接正方形,和内接菱形。。
#include<iostream> #include<stdio.h> using namespace std; int main() { double a,b; while(scanf("%lf%lf",&a,&b)!=EOF) printf("%f %f\n",2 * a * b,(4 * a * a * b * b)/(a * a + b * b)); return 0; }
标签:
原文地址:http://www.cnblogs.com/lyf-acm/p/5449298.html