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 1

Sample Output

  1. 2 2
  1. 题意:一个椭圆内切一个平行四边形,平行四边形里内切一个以原点为圆心的圆
  1. 解题思路:(这撒比的题意,和刘哲贤学姐愣是猜了两个多小时)最后能出的题都出了,他俩在搞下雨的那个数学题,我在看题,画来画去最后还是觉得里面内切一个圆才合适,好好高中几何学的够硬,比划着找出来两个临界状态,但是最后一句话,说了保留精度,但是案例没有输出小数点,唉~弄得最后这个题没出,还是比完赛才试着改了改提交了。
  1. 感悟:灵光一闪太**的重要了;
  1. 代码:
  1. #include
  1. #include
  1. using namespace std;
  1. int main()
  1. {
  1. double a,b;
  1. while(scanf("%lf%lf",&a,&b)!=EOF)
  1. printf("%f %f\n",2*a*b,(4*a*a*b*b)/(a*a+b*b));
  1. return 0;
  1. }

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. multimap 和priority_queue详解

    上一期是关于STL和并查集结合的例题,也附了STL中部分容器的使用摘要,由于是从网上东拼西凑的,感觉有的关键点还是没解释清楚,现在从其中摘出两个容器,用例题对它们的用法进行进一步解释. 以下是例题的介 ...

  2. angular之$watch方法详解

    在$apply方法中提到过脏检查,首先apply方法会触发evel方法,当evel方法解析成功后,会去触发digest方法,digest方法会触发watch方法. (1)$watch简介 在diges ...

  3. 使用.net 自建短链接(短网址)

    短连接大家都不陌生,例如新浪的 t.cn .京东的 3.cn .淘宝的 tb.cn 等等.都已经是家喻户晓的短连接域名.不知道有多少人像我一样,对短连接原理好奇而且尝试自建了呢? 今天发布这个文章的目 ...

  4. 使用 TUN 设备实现一个简单的 UDP 代理隧道

    若要实现在 Linux 下的代理程序,方法有很多,比如看着 RFC 1928 来实现一个 socks5 代理并自行设置程序经过 socks5 代理等方式,下文是使用 Linux 提供的 tun/tap ...

  5. centos 6.5系统下安装ibus及设置开机自启动

    先说一下系统环境:centos 6.5,然后我是以root身份执行的,没有权限的用户参见sudo用法 第1步:查找并安装ibus安装包,命令如下: 找到一行: ibus-pinyin.x86_64 : ...

  6. spring cloud+dotnet core搭建微服务架构:配置中心(四)

    前言 我们项目中有很多需要配置的地方,最常见的就是各种服务URL地址,这些地址针对不同的运行环境还不一样,不管和打包还是部署都麻烦,需要非常的小心.一般配置都是存储到配置文件里面,不管多小的配置变动, ...

  7. sqlserver 使用脚本创建Sql Server代理作业

    use master GO /* --开启sql server代理 sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_con ...

  8. Jquery实现按钮点击遮罩加载,处理完后恢复

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="EasyUiLoad.aspx. ...

  9. ios获取内核数目

    #include <mach/mach_host.h> unsigned int countCores() { host_basic_info_data_t hostInfo; mach_ ...

  10. iOS 将视频流(h264)和音频流封装成PS流

    调用方法: static  CPSPackager * testObjc = NULL; static char *pszBuffer; testObjc = new CPSPackager(); p ...