码迷,mamicode.com
首页 > 其他好文 > 详细

2016 省赛热身 Ellipse

时间:2016-04-30 22:03:20      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

 Ellipse
Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu
 

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 b0 < 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;
}

 



2016 省赛热身 Ellipse

标签:

原文地址:http://www.cnblogs.com/lyf-acm/p/5449298.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!