Description

There is an beautiful ellipse whose curve equation is:

b > 0)" src="http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif" real_src="http://7xjob4.com1.z0.glb.clouddn.com/a2c4a3e858cca826fc22c99764587f6e" title="Ellipse">

.

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
#include
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;
}

Ellipse的更多相关文章

  1. [svg翻译教程]椭圆(ellipse元素)和线(line元素)

    line 先看个例子,这是svg中最简单的线 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http:/ ...

  2. [javascript svg fill stroke stroke-width rx ry ellipse 属性讲解] svg fill stroke stroke-width ellipse 绘制椭圆属性讲解

    <!DOCTYPE html> <html lang='zh-cn'> <head> <title>Insert you title</title ...

  3. svg学习(五)ellipse

    <ellipse> 标签 <ellipse> 标签可用来创建椭圆.椭圆与圆很相似.不同之处在于椭圆有不同的 x 和 y 半径,而圆的 x 和 y 半径是相同的. <?xm ...

  4. HDU 1724 Ellipse(数值积分の辛普森公式)

    Problem Description Math is important!! Many students failed in 2+2’s mathematical test, so let's AC ...

  5. Kinetic使用注意点--ellipse

    new Ellipse(config) 参数: config:包含所有配置项的对象. { radius: "半径,可以用数字a.数组[a,b]或对象{x:a,y:b}来表示" } ...

  6. HDU 2876 Ellipse, again and again

    转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://acm.hdu.edu.cn/showproblem.php ...

  7. hdu 1724 Ellipse simpson积分

    /* hdu 1724 Ellipse simpson积分 求椭圆的部分面积 simpson积分法 http://zh.wikipedia.org/zh-tw/%E8%BE%9B%E6%99%AE%E ...

  8. windows phone (14) 简单了解Ellipse元素和Rectangle元素

    原文:windows phone (14) 简单了解Ellipse元素和Rectangle元素  System.Windows.Shapes命名空间中包含了显示矢量图形的元素分别为ellipse和re ...

  9. Raphael初始化,path,circle,rect,ellipse,image

    path jsp: <%@ page language="java" contentType="text/html; charset=UTF-8" pag ...

随机推荐

  1. 初入ubuntu

    登入root :su root 安装 vim: sudo apt-get install vim 安装 gcc(g++):sudo apt-get install gcc(g++) 非常实用的修改分辨 ...

  2. JSTL之c:set

    <jsp:setProperty>标记只能用来做一件事,那就是设置bean的性质. 但是,如果你想设置一个Map中的值呢?或者说想在Map中创建新的一项呢?或者只是希望创建一个新的请求作用 ...

  3. Quartz源码——scheduler.start()启动源码分析(二)

    scheduler.start()是Quartz的启动方式!下面进行分析,方便自己查看! 我都是分析的jobStore 方式为jdbc的SimpleTrigger!RAM的方式类似分析方式! Quar ...

  4. 【模板】AC自动机(加强版)

    题目描述 有个由小写字母组成的模式串以及一个文本串.每个模式串可能会在文本串中出现多次.你需要找出哪些模式串在文本串中出现的次数最多. 输入输出格式 输入格式: 输入含多组数据. 每组数据的第一行为一 ...

  5. Python in/not in --- if not/if + for...[if]...构建List+ python的else子句

    区分几个容易出错的地方: in 成员运算符 - 如果字符串中包含给定的字符返回 True >>>"H" in a True not in 成员运算符 - 如果字符 ...

  6. cmd获取python返回值

    test.py代码如下: import urllib2 import sys try: f = urllib2.urlopen('http://www.baidu.com/',timeout = 10 ...

  7. ZOJ1171

    错误代码先放这 #include<cstdio> #include<cstdlib> #include<iostream> #include<cstring& ...

  8. SQL server学习(五)——T-SQL编程之存储过程

    周五了,祝大家周末愉快. 之前一直在写SQL server的分享,今天再来个T-SQL编程中的存储过程. 存储过程 存储过程(procedure)类似于C语言中的函数,用来执行管理任务或应用复杂的业务 ...

  9. win10 UWP Hmac

    HMAC是密钥相关的哈希运算消息认证码,输入密钥和信息. 在uwp,Hmac在很多网络使用,我最近写qiniu SDK,把原来C#改为UWP,需要使用HMAC. 上传文件 <form metho ...

  10. win10 uwp 后台获取资源

    本文告诉大家,从后台代码获取界面定义的资源. 如果一个资源是写在 App 的资源,那么如何使用代码去获得他? 简单的方法是使用下面的代码 Application.Current.Resources[& ...