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 ...
随机推荐
- Angular JS 基础应用--第一篇
前 言 Android应用开发中,有一些功能虽然能够使用原生JS来实现,但是会比较的复杂,因此一些相应的框架应运而生了.框架相对于原生JS而言,从主观上来说,最大的改变就是代码 ...
- python 库之lxml安装 坑一个
error: command 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python ...
- 代码与编程(java基础)
代码与编程(面试与笔试java) 1.写一个Singleton出来 Singleton模式主要作用是保证在Java应用程序中,一个类Class只有一个实例存在. 一般Singleton模式通常有几种种 ...
- Detect Capital
Given a word, you need to judge whether the usage of capitals in it is right or not. We define the u ...
- Windows下如何创建低权限进程
1. 前言 在使用 Sysinternals 出品的 Process Explorer 过程中,对 “Run as Limited User” 功能的实现方式颇感兴趣,一番搜寻之下发现Mark ...
- CentOS7 Redis安装
Redis介绍 1.安装Redis 官方下载地址:http://download.redis.io 使用Linux下载:wget http://download.redis.io/redis-stab ...
- web应用程序 前段部分调优
1. 使用瀑布图初步诊断网站性能瓶颈 一般来说,打开一个网页的速度会受到以下几项的影响: 1) 服务器花了太长的时间将.aspx页面的内容转化为html. 2) .aspx页面花了太长的时间从服务器端 ...
- FPGA在其他领域的应用(一)
测试和测量应用: 测试需要是所有细分市场的要求.无论是终端市场,所有产品在运到最终客户之前都必须进行测试.这动态地驱动测试和测量领域的普遍性质,其中包括下面的种类和分段: 通信测试: 无线测试仪 (W ...
- 扩展jquery.validate自定义验证,自定义提示,本地化
<!DOCTYPE html> <html> <head> <meta name="viewport" content="wid ...
- 数据库的优化(表优化和sql语句优化)
在这里主要是分为表设计优化和sql语句优化两方面来实现. 首先的是表设计优化: 1.数据行的长度不要超过8020字节.如果是超过这个长度的话这条数据会占用两行,减低查询的效率. 2.能用数字类型就不要 ...