Time Limit: 2 Seconds      Memory Limit: 65536 KB


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

做点水题,舒缓心情,享受人生

简单计算几何

大概没什么好解释的,放进去两个圆以后,根据它们的“横纵方向最大间隔距离”和“半径之和”来判断能否装下。

 /*by SilverN*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int mxn=;
double a,b,r1,r2;
int main(){
while(scanf("%lf%lf%lf%lf",&a,&b,&r1,&r2)!=EOF){
if(a<b)swap(a,b);
if(r1<r2)swap(r1,r2);
if(b<=r1*){printf("No\n");continue;}
double x1=a-r1-r2;
double y1=b-r1-r2;
double r=r1+r2;
if(x1*x1+y1*y1-r*r>=0.01)
printf("Yes\n");
else printf("No\n");
}
return ;
}

ZOJ1608 Two Circles and a Rectangle的更多相关文章

  1. ZOJ 1608 Two Circles and a Rectangle

    Give you two circles and a rectangle, your task is to judge wheather the two circles can be put into ...

  2. LightOJ 1366 - Pair of Touching Circles (统计矩形内外切圆对)

    1366 - Pair of Touching Circles   PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limi ...

  3. javascript: jquery.gomap-1.3.3.js

    from:http://www.pittss.lv/jquery/gomap/solutions.php jquery.gomap-1.3.3.js: /** * jQuery goMap * * @ ...

  4. how to detect circles and rectangle?

    opencv中对圆检测的函数为:HoughCircles(src_gray,circles,CV_HOUGHT_GRADIENT,1,src_gray.cols/8,200,100,0,0) circ ...

  5. Java基础之在窗口中绘图——使用模型/视图体系结构在视图中绘图(Sketcher 1 drawing a 3D rectangle)

    控制台程序. 在模型中表示数据视图的类用来显示草图并处理用户的交互操作,所以这种类把显示方法和草图控制器合并在一起.不专用于某个视图的通用GUI创建和操作在SketcherFrame类中处理. 模型对 ...

  6. Circles and Pi

    Circles and Pi Introduction id: intro-1 For as long as human beings exist, we have looked to the sky ...

  7. [LeetCode] Perfect Rectangle 完美矩形

    Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover o ...

  8. [LeetCode] Max Sum of Rectangle No Larger Than K 最大矩阵和不超过K

    Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix s ...

  9. [LeetCode] Smallest Rectangle Enclosing Black Pixels 包含黑像素的最小矩阵

    An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black ...

随机推荐

  1. Centos7之Nginx

    1.安装 下载RPM: wget http://nginx.org/download/nginx-1.16.0.tar.gz 解压:tar -zxf nginx-1.16.0.tar.gz 安装: c ...

  2. 【WordPress】CentOS 6.10 测试WP发送邮件失败

    1.错误信息如下: SMTP -> ERROR: Failed to connect to server: Permission denied (13) 2.解决方法: https://gist ...

  3. centos7中使用LVM管理磁盘和挂载磁盘

    centos7使用LVM管理一块新的磁盘 注意!文中凡是带#的都是命令标志. 一些重要概念: LV(Logical Volume)- 逻辑卷, VG(Volumne Group)- 卷组, PV(Ph ...

  4. thinkphp 3.2.3 - App.class.php 解析

    class App { public static function init() { load_ext_file(COMMON_PATH); // { // /home/www/www.domain ...

  5. SSH无密码登录及远程拷贝命令SCP的使用

    SSH无密码登录 1.生成密钥对(公钥和私钥) $ cd /home/cen/.ssh $ ssh-keygen -t rsa #生成密钥,使用rsa方式进行加密,四个回车 $ ssh-copy-id ...

  6. 重写BaseAdapter实现ListView

    public class BaseAdapterActivity extends BaseActivity { private ListView base_adapter_listView; priv ...

  7. TCP/IP网络编程之多种I/O函数

    send和recv函数 在之前的学习中,我们在不少示例中用到send和recv这两个函数,但一直没有详细解释过着两个函数中每个参数的含义.本节将介绍Linux平台下的send&recv函数 # ...

  8. 在Foxmail中添加阿里云企业邮箱账号

    1.安装完成Foxmail之后,新建账号 输入阿里云邮箱地址和密码,点击创建 接受服务器类型你可以选择POP3或者IMAP,在这里我选择的是POP3 点击创建,大功告成. 为什么要写这篇文章呢? 因为 ...

  9. cf980d Perfect Groups

    题意 定义一个串的权值是将其划分成 \(k\) 组,使得每一组在满足"从组里选出一个数,再从组里选出一个数,它们的乘积没有平方因子"这样的前提时的最小的 \(k\).每组的数不必相 ...

  10. 图说不为人知的IT传奇故事-1-计算机新生

    此系列文章为“图说不为人知的IT传奇故事”,各位大忙人可以在一分钟甚至几秒内了解把握整个内容,真可谓“大忙人的福利”呀!!希望各位IT界的朋友在钻研技术的同时,也能在文学.历史上有所把握.了解这些故事 ...