Ellipse
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 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的更多相关文章
- [svg翻译教程]椭圆(ellipse元素)和线(line元素)
line 先看个例子,这是svg中最简单的线 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http:/ ...
- [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 ...
- svg学习(五)ellipse
<ellipse> 标签 <ellipse> 标签可用来创建椭圆.椭圆与圆很相似.不同之处在于椭圆有不同的 x 和 y 半径,而圆的 x 和 y 半径是相同的. <?xm ...
- HDU 1724 Ellipse(数值积分の辛普森公式)
Problem Description Math is important!! Many students failed in 2+2’s mathematical test, so let's AC ...
- Kinetic使用注意点--ellipse
new Ellipse(config) 参数: config:包含所有配置项的对象. { radius: "半径,可以用数字a.数组[a,b]或对象{x:a,y:b}来表示" } ...
- HDU 2876 Ellipse, again and again
转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://acm.hdu.edu.cn/showproblem.php ...
- hdu 1724 Ellipse simpson积分
/* hdu 1724 Ellipse simpson积分 求椭圆的部分面积 simpson积分法 http://zh.wikipedia.org/zh-tw/%E8%BE%9B%E6%99%AE%E ...
- windows phone (14) 简单了解Ellipse元素和Rectangle元素
原文:windows phone (14) 简单了解Ellipse元素和Rectangle元素 System.Windows.Shapes命名空间中包含了显示矢量图形的元素分别为ellipse和re ...
- Raphael初始化,path,circle,rect,ellipse,image
path jsp: <%@ page language="java" contentType="text/html; charset=UTF-8" pag ...
随机推荐
- Finally-操作返回值
Finally中操作返回会出现一个问题?直接看代码 static int M1() { ; try { result = result + ; //======引发异常的代码========== , ...
- uva 10391
这个题,单纯做出来有很多种方法,但是时间限制3000ms,因此被TL了不知道多少次,关键还是找对最优解决方法,代码附上: #include<bits/stdc++.h> using nam ...
- 修改Form ->Top和Left 造成的莫名其妙的显示异常 “轴信息”
相关代码: 运行程序: 要等待很久,或者把主窗体最小化,再最大化打开"轴信息" 才会恢复正常. 这个"不爽"很蛋蛋 ,网友亲亲们,有独到见解的亲亲们,期待得到你 ...
- submit text3的激活与使用
SublimeText3常用快捷键和优秀插件 SublimeText是前端的一个神器,以其精简和可DIY而让广大fans疯狂.好吧不吹了直入正题 -_-!! 首先是安装,如果你有什么软件管家的话搜一下 ...
- POJ1083 Moving Tables(模拟)
The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in ...
- redis C接口hiredis 简单函数使用介绍
hiredis是redis数据库的C接口,目前只能在linux下使用,几个基本的函数就可以操作redis数据库了. 函数原型:redisContext *redisConnect(const char ...
- asp.net mvc 自动化测试工具
好久不写文章了,一直忙在项目中. 前一阵发现公司一个项目,体积巨大.业务很复杂.基于历史原因,项目基于mvc 2迁移过来,视图大多还是aspx 作为视图承载. 控制器中的方法 更是一个比一个多. ...
- sqlDependency监控数据库数据变化,自动通知
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- 在SQLSERVER中创建DBLINK,操作远程服务器数据库
--配置SQLSERVER数据库的DBLINK exec sp_addlinkedserver @server='WAS_SMS',@srvproduct='',@provider='SQLOLEDB ...
- UpdatePanel控件的使用和局部刷新
http://www.cnblogs.com/baiefjg/archive/2009/06/14/1502813.html