New Year Table

Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u

Description

Gerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those guests. Consider all plates to be round and have the same radii that equal r. Each plate must be completely inside the table and must touch the edge of the table. Of course, the plates must not intersect, but they can touch each other. Help Gerald determine whether the table is large enough for n plates.

Input

The first line contains three integers nR and r (1 ≤ n ≤ 100, 1 ≤ r, R ≤ 1000) — the number of plates, the radius of the table and the plates' radius.

Output

Print "YES" (without the quotes) if it is possible to place n plates on the table by the rules given above. If it is impossible, print "NO".

Remember, that each plate must touch the edge of the table.

Sample Input

Input
4 10 4
Output
YES
Input
5 10 4
Output
NO
Input
1 10 10
Output
YES

Hint

The possible arrangement of the plates for the first sample is

题解:小圆贴着大圆的边,问是否能放n个;注意精度;

代码:

#include<iostream>
#include<cstdio>
#include<cmath>
#in\
clude<algorithm>
using namespace std;
const double PI = acos(-1.0);
int main(){
int n, R, r;
while(~scanf("%d%d%d", &n, &R, &r)){
if(r > R){
if(n == )
puts("YES");
else
puts("NO");
continue;
}
else if(r == R){
if(n <= )
puts("YES");
else
puts("NO");
continue;
} else if( * r > R){
if(n <= )
puts("YES");
else
puts("NO");
continue;
}
double cosa = (2.0 * (R - r) * (R - r) - (2.0*r) * (2.0*r))/ (2.0*(R-r)*(R-r));
double a = acos(cosa);
//printf("%lf\n", 2.0 * PI / a);
if((n - 2.0 * PI / a) <= 1e-){
puts("YES");
}
else{
puts("NO");
}
}
}

New Year Table(几何)的更多相关文章

  1. CodeForces - 140A New Year Table (几何题)当时没想出来-----补题

    A. New Year Table time limit per test2 seconds memory limit per test256 megabytes inputstandard inpu ...

  2. DOM 元素节点几何量与滚动几何量

    当在 Web 浏览器中查看 HTML 文档时,DOM 节点被解析,并被渲染成盒模型(如下图),有时我们需要知道一些信息,比如盒模型的大小,盒模型在浏览器中的位置等等,本文我们就来详细了解下元素节点的几 ...

  3. Arcgis 几何网络分析

    ArcGIS:网络分析(转)   由于之前对网络分析的理解有很多问题,所以在网上找了一些资料,这是其中一篇我觉得比较好的,所以就整理了一下,发到网上来,留个底吧,呵呵 注:关于几何网络的建立见前面的& ...

  4. ACM: CodeForces 140A New Year Table-数学几何

    CodeForces 140A New Year Table Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d ...

  5. [ACM_几何] UVA 11300 Spreading the Wealth [分金币 左右给 最终相等 方程组 中位数]

    Problem A Communist regime is trying to redistribute wealth in a village. They have have decided to ...

  6. postgis几何操作函数集

    管理操作函数 AddGeometryColumn - Adds a geometry column to an existing table of attributes. By default use ...

  7. DHT(Distributed Hash Table,分布式哈希表)

    DHT(Distributed Hash Table,分布式哈希表)类似Tracker的根据种子特征码返回种子信息的网络. DHT全称叫分布式哈希表(Distributed Hash Table),是 ...

  8. Jack Straws POJ - 1127 (几何计算)

    Jack Straws Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5428   Accepted: 2461 Descr ...

  9. OGC定义的几何要素

    OGC定义了两种描述几何对象的格式,分别是WKB(Well-Known Binary)和WKT(Well-Known Text). 在SQL语句中,用以下的方式可以使用WKT格式定义几何对象:几何类型 ...

随机推荐

  1. uva 111 History Grading(最长公共子序列)

    题目连接:111 - History Grading 题目大意:给出一个n 代表序列中元素的个数, 然后是一个答案, 接下来是若干个同学的答案(直到文件结束为止), 求出两个序列的最长公共子序列, 注 ...

  2. openfire文件夹

    插件开发 学习制作第一个 openfire 插件 http://www.cnblogs.com/jying/p/3683409.html 跟我一步一步开发自己的Openfire插件 http://bl ...

  3. 安装VMware Sphere ESXi 5.5

    安装VMware Sphere ESXi 5.5 1.准备 待安装ESXi 5.5的机器需要大于2GB以上内存,并且支持64位和虚拟化. 下载:VMware-VMvisor-Installer-5.5 ...

  4. 开始学javascript基础

    JavaScript非常值得我们学习. 1)所有主浏览器都支持JavaScript. 2) 目前,全世界大部分网页都使用JavaScript. 3) 它可以使网页呈现各种动态效果. 4)作为一个Web ...

  5. Windows命令行(DOS命令)教程 -1 (转载) http://www.pconline.com.cn/pcedu/rookie/basic/10111/15325.html

    一.命令行简介 命令行就是在Windows操作系统中打开DOS窗口,以字符串的形式执行Windows管理程序. 在这里,先解释什么是DOS? DOS--Disk Operation System 磁盘 ...

  6. iOS在MRC工程环境下下使用ARC的方法

  7. 利用MiddleGen-hibernate-r5生成hbm文件及POJO文件

    1       先决条件 1.1    已安装JDK(版本1.5以上)并配置环境变量 到http://java.sun.com上下载JDK,配置环境变量(我的电脑右键->属性->高级-&g ...

  8. (原)10-folder交叉验证

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6069731.html 参考网址: https://github.com/cmusatyalab/ope ...

  9. ognl.NoSuchPropertyException(没有对应属性异常)

    ognl.NoSuchPropertyException: com.xie.struts2.tags.modal.Student.sName(没有对应属性异常) at ognl.ObjectPrope ...

  10. hadoop调优之一:概述

    hadoop集群性能低下的常见原因 (一)硬件环境 1.CPU/内存不足,或未充分利用 2.网络原因 3.磁盘原因 (二)map任务原因 1.输入文件中小文件过多,导致多次启动和停止JVM进程.可以设 ...