2016 provincial warming Ellipse

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.