题干:

The Swedish company SKF makes ball bearings. As explained by Britannica Online, a ball bearing is “one of the two types of rolling, or anti friction, bearings (the other is the roller bearing).

Its function is to connect two machine members that move relative to one another so that the frictional resistance to motion is minimal. In many applications, one of the members is a rotating shaft and the other a fixed housing. Each ball bearing has three main parts: two grooved, ring like races and a number of balls. The balls fill the space between the two races and roll with negligible friction in the grooves. The balls may be loosely restrained and separated by means of a retainer or cage.” 
Presumably, the more balls you have inside the outer ring, the smoother the ride will be, but how many can you t within the outer ring? You will be given the inner diameter of the outer ring, the diameter of the balls, and the minimum distance between neighboring balls. Your task is to compute the maximum number of balls that will t on the inside of the outer ring (all balls must touch the outer ring). 

Input

The first line of input contains a positive integer n that indicates the number of test cases. Then follow n lines, each describing a test case. Each test case consists of three positive oating point numbers, D, d, s, where D is the inner diameter of the outer ring, d is the diameter of a ball, and s is the minimum distance between balls. All parameters are in the range [0.0001, 500.0].

Output

For each test case output a single integer m on a line by itself, where m is the maximum number of balls that can t in the ball bearing, given the above constraints. There will always be room for at least three balls.

Sample Input

2
20 1 0.1
100.0 13.0 0.2

Sample Output

54
20

题目大意:

首先是一个t,表示输入实例数。以下每行是一个实例,有3个浮点正数,D,d,s。D是大圆的直径,d是小圆的直径,s是依序相邻的小圆之间的最小距离。所有参数都是在[0.0001, 500.0]范围内。

解题报告:

直接计算出圆心角,然后PI/圆心角就可以了。

AC代码:

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<set>
#include<string>
#include<cmath>
#include<cstring>
#define ll long long
#define pb push_back
#define pm make_pair
using namespace std;
const double PI = acos(-1.0);
int main()
{int t;cin>>t;double s,d,D;while(t--) {scanf("%lf%lf%lf",&D,&d,&s);printf("%d\n",(int)(PI/asin((d+s)/(D-d))));} return 0 ;
}

【HDU - 1943】Ball bearings(几何问题)相关推荐

  1. HDU 1174 爆头(几何---叉积)

    爆头 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submiss ...

  2. HDU 5821 Ball

    记录一下每个位置最终到达的位置.然后每次操作排序. #pragma comment(linker, "/STACK:1024000000,1024000000") #include ...

  3. 类的组合在什么情况下使用_什么情况下选择使用圆锥滚子轴承?(原创轴承外贸写作素材)...

    什么情况下选择使用圆锥滚子轴承?(轴承外贸写作素材) When should you choose to use tapered roller bearings? (Bearing foreign t ...

  4. HOJ题目分类//放这儿没事刷刷学算法!嘻嘻!

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  5. python接口自动化用例管理_python接口自动化测试(六)-unittest-单个用例管理

    前面五节主要介绍了环境搭建和requests库的使用,可以使用这些进行接口请求的发送.但是如何管理接口案例?返回结果如何自动校验?这些内容光靠上面五节是不行的,因此从本节开始我们引入python单元测 ...

  6. ROW_NUMBER、RANK、DENSE_RANK的用法

    --NND,索性把2005的一起帖出来. ROW_NUMBER.RANK.DENSE_RANK的用法 (爱新觉罗.毓华 2007-12-16 广东深圳)SQL Server 2005 引入几个新的排序 ...

  7. SQL2005中row_number( )、rank( )、dense_rank( )、ntile( )函数的用法(1)

    ROW_NUMBER.RANK.DENSE_RANK的用法 SQL Server 2005 引入几个新的排序(排名)函数,如ROW_NUMBER.RANK.DENSE_RANK等. 这些新函数使您可以 ...

  8. UVA499 What‘s The Frequency, Kenneth?【文本】

    #include <stdio.h> main() {     int i;     char *suffix[]= { "st", "nd", & ...

  9. 杭电OJ分类题目(1)

    原题出处:HDOJ Problem Index by Type,http://acm.hdu.edu.cn/typeclass.php 杭电OJ分类题目(1) HDU Introduction HDU ...

最新文章

  1. JavaScript排序算法——插入排序算法
  2. 【LCT】弹飞绵羊(luogu 3203/金牌导航 LCT-2)
  3. constraintlayout布局新特性_AMD发布Ryzen PRO 4000系列移动处理器:多了超线程和商用安全特性...
  4. CRC16算法之三:CRC16-CCITT-MODBUS算法的java实现
  5. 渗透测试 已学课时 1 个_我14岁上创业课时学到的东西
  6. 618 技术特辑(一)不知不觉超预算3倍,你为何买买买停不下来?
  7. js ajax 表单异步提交
  8. 【UML】部署图和构件图
  9. 百度云盘群组中资源文件实时同步更新保存到自己群组的方法
  10. waves效果器_waves效果器:《我不是药神》配乐炼成记—Waves访时俊峰黄超
  11. gsoap linux中文乱码,gsoap中文乱码及内存清理等问题的解决方案
  12. Jetpack Compose - CircularProgressIndicator、LinearProgressIndicator
  13. 浅述Docker的容器编排
  14. python的for语句有几种写法_python的for循环写法
  15. win10网络适配器不见了_win10没有网络适配器怎么办
  16. rails 中的pluck 方法
  17. 重置 winsocks
  18. 影视剧广告植入,对于品牌宣传有怎样的效果?
  19. python无法运行图像_OpenCV Python不使用imread()打开图像
  20. mysql高性能 pdf_高性能MySQL(第3版)(High Performance MySQL) pdf扫描版

热门文章

  1. 解决firefox不能安装Flash插件
  2. vba xml 怎么设置父节点_熊二做了一个xml报文处理的开源库easyxml
  3. 同名字的数值求和插入行_EXCEL条件求和的6种技术,你会的超过3种吗?
  4. oracle字段加约束,Oracle数据库的字段约束创建和维护示例
  5. 专业对不对口重要吗_应届生求职,专业对口到底重不重要?
  6. 十天学会PHP(第五版),十天学会php之第五天
  7. python如何对一个属性或方法进行封装_python 类、对象、方法、属性
  8. ftp 服务器 文件 连接 导出,ftp 服务器 文件 连接 导出
  9. idea maven创建java项目_新版本IntelliJ IDEA 构建maven,并用Maven创建一个web项目(图文教程)...
  10. json返回页面读取data里的值都是object_【一】尤大神都说Vite香,让我来手把手分析Vite原理...