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. 【SAM manacher 倍增】bzoj3676: [Apio2014]回文串

    做法一:PAM:做法二:SAM+manacher.前缀树上倍增 Description 考虑一个只包含小写拉丁字母的字符串s.我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度.请你 ...

  2. nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument解决

    先附上错误信息: (myblog) root@Dapeng:/home/uwsgi# service nginx status ● nginx.service - A high performance ...

  3. select * 比select column快很多奇怪案例分析

    遇到MYSQL傻傻的地方,下面给个案例,大家感受下: 注意以下两个sql只有select *和select g.id区别. SQL1:SELECT g.idFROM table1 gINNER JOI ...

  4. jupyter notebook(三)——IOPub_data_rate_limit报错

    一.问题 运行jupyter notebook,然后运行python代码,读取文件处理时,会报错.发现时IO读取时错误.应该是IO速率问题. 下面是问题报错: IOPub data rate exce ...

  5. Redis之set类型操作

    接口: package com.net.test.redis.base.dao; /** * @author*** * @Time:2017年8月10日 下午2:32:12 * @version 1. ...

  6. Python数据类型的用法

    字符串的用法 res = 'hellow,world' print(res) #res.显示的都是它的方法,下划线的除外 1 判断字符串的结尾字符,返回的值的布尔形式 endswith 判断字符串的开 ...

  7. Django2.2使用mysql数据库pymysql版本不匹配问题的解决过程与总结

    前置条件 django版本:2.2.1 python版本:3.6.6 mysql版本:mysql-community8.0.15 问题 在搭建django项目,配置mysql数据库时遇到无法迁移数据库 ...

  8. python3.7 random模块

    #!/usr/bin/env python __author__ = "lrtao2010" #python3.7 random模块 import random #随机模块 # r ...

  9. django之配置静态文件

    # 别名 STATIC_URL = '/static/' # 配置静态文件,名字必须是STATICFILES_DIRS STATICFILES_DIRS = [ os.path.join(BASE_D ...

  10. luogu4169 [Violet]天使玩偶/SJY摆棋子 / bzoj2648 SJY摆棋子 k-d tree

    k-d tree + 重构的思想,就能卡过luogu和bzoj啦orz #include <algorithm> #include <iostream> #include &l ...