EllipseTime
limit:2000MS
Memory Limit:65536KB
64bit IO Format:%lld &%llu< /c8>
Description
There is a beautiful ellipse whose curve equation is:
.
There is a parallelogram named P inscribed in this ellipse. At the same time, the parallelogram are P externally tangent to some circle center at the Origin (0,0) .
Now your task was 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, the there is exactly one line consists of both integers and a b .0 < b <= a <= 109
Output
For each test case, output one line of One-space splited numbers:the maximum area and the minimum area. The absolute or relative error of the coordinates should is no more than 10-6.
Sample Input
1 1
Sample Output
2 2
Simple test Instructions:
The elliptic equation is given, then the inner parallelogram is obtained, but this parallel four-sided row must be connected with a circle,
The maximum minimum area to match the condition.
Simple idea:
By the conditions can be introduced, the largest minimum is, the inner square, and the inner diamond.
#include <iostream>#include<stdio.h>using namespacestd;intMain () {Doubleb; 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;}
2016 provincial warming Ellipse