Give you two circles and a rectangle, your task is to judge wheather the two circles can be put into the rectangle with no part of circles outside the retangle.

Input

There are multiple test cases. In every test cast, there are four float-point numbers:

a, b, r1, r2

where, a and b are two sides of the rectangle, r1 and r2 are radii of the two circls.

Output

Print a "Yes", if the circles can be put into the rectangle. Otherwise, print a "No".

You can safely assume x < y, where x and y are float-point numbers, if x < y + 0.01.

Sample Input

5 4 1 1
5 4 1.5 2

Sample Output

Yes
No

//数学一本通习题 1
//ZOJ 1608 判断两个圆能否放入一个矩形中 //题意:给你一个矩形和两个圆,问能否把这两个圆放进矩形里(圆不能相交或包含) //最好(省空间)的放置方法显然是两个圆分别与两条对边相切,且这两个圆也相切
//假如两个圆是按上面的方法放的,且刚好能放下(即两组邻边分别与两个圆相切)
//那么假设两个圆圆心的距离是z
//以z为斜边,x平行于长,y平行于宽做直角三角形 ,则
//z=r1+r2
//x=a-r1-r2=a-z
//y=b-r1-r2=b-z
//所以,z是固定的,x和y取决于矩形的边长
//那么如果x^2+y^2==z^2的话,就是刚好能放下,>=就是能放下了 #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std; const int N=1e5+; double a,b,r1,r2;
double x,y,z; int main()
{
while(scanf("%lf%lf%lf%lf",&a,&b,&r1,&r2)!=EOF)
{
z=r1+r2;
if(a<b) //让a是长边,b是短边
swap(a,b);
if(r1<r2) //r1是大圆,r2是小圆
swap(r1,r2);
x=a-z,y=b-z;
if(x*x+y*y>=z*z)
puts("Yes");
else
puts("No");
}
return ;
}

最新文章

  1. Linux查看tomcat 控制台输出命令
  2. 破解myEclipse
  3. 【C语言入门教程】4.7 指针的地址分配 - mallocl(), free()
  4. 【动态规划】拦截导弹_dilworth定理_最长递增子序列
  5. surface RT app安装心得
  6. 09 高效的PL/SQL程序设计
  7. 关于B/S系统中文件上传的大小限制怎么做
  8. ubuntu查看命令
  9. django: startproject
  10. C++中初始化和定义对象的语法,带括号与不带括号的区别
  11. JAVA逻辑运算符
  12. java利用WatchService实时监控某个目录下的文件变化并按行解析(注:附源代码)
  13. 二叉排序树(BST)构造与应用
  14. 剑指offer-机器人的运动范围
  15. python rtree包查找三维空间下的最近设备
  16. Scala进阶之路-正则表达式案例
  17. Matlab中小语法点总结(更新中)
  18. OpenGL学习笔记:Console工程下如何不显示控制台黑窗口只显示Windows窗口
  19. 1207. [HNOI2004]打鼹鼠【线性DP】
  20. 缓存数据库-redis安装和配置

热门文章

  1. gitlab-runner 的 executors 之 docker
  2. [洛谷P5431]【模板】乘法逆元2
  3. LOJ6300 博弈论与概率统计 组合、莫队
  4. 系统开启UAC情形下开机自启动程序如何以管理员权限启动
  5. (二) Windows 进行 Docker CE 安装(Docker Desktop)
  6. ④ Python3.0字符串
  7. ubuntu ufw 配置
  8. Java中使用HttpPost上传文件以及HttpGet进行API请求(包含HttpPost上传文件)
  9. Mycat分布式数据库架构解决方案--rule.xml详解
  10. css3可拖动的魔方3d