Ellipse

Description

There is an beautiful ellipse whose curve equation is:

\frac {x^2}{a^2} + \frac {y^2}{b^2} = 1 (a > b > 0)
.

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
题意:一个椭圆内切一个平行四边形,平行四边形里内切一个以原点为圆心的圆
解题思路:(这撒比的题意,和刘哲贤学姐愣是猜了两个多小时)最后能出的题都出了,他俩在搞下雨的那个数学题,我在看题,画来画去最后还是觉得里面内切一个圆才合适,好好高中几何学的够硬,比划着找出来两个临界状态,但是最后一句话,说了保留精度,但是案例没有输出小数点,唉~弄得最后这个题没出,还是比完赛才试着改了改提交了。
感悟:灵光一闪太**的重要了;
代码:


  std
 

     ab
    abEOF
        abaabbaabb
     

转载于:https://www.cnblogs.com/wuwangchuxin0924/p/5781556.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值