博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hzau 1204 Escape from the Darkness
阅读量:4684 次
发布时间:2019-06-09

本文共 1509 字,大约阅读时间需要 5 分钟。

1204: Escape from the Darkness

Time Limit: 1 Sec  Memory Limit: 1280 MB
Submit: 93  Solved: 3
[][][]

Description

     Xiao Ming, a high school student, learnt blackbody radiation from the physics class. The black body on the book is indicated approximately by black body cavity as below: 

 from the small hole if total reflection occurs on the surface of the cavity.

    Assuming in the two-dimensional coordinates, the center of the oval is at origin, and the vertexes of it is respectively (a, 0), (-a, 0), (0, b), (0, -b). There is a small hole at (a/2,sqrt(3)*b/2) (whose areas can be ignored). A beam of light (whose diameter can be ignored) shoot into the oval through the small hole. The direction of the light is (-1, 0). Assuming the light totally mirror reflects on the surface of the oval, the question is how many times can the light reflect before shooting out through the small hole. (If a point is away from the small hole less than 0.01, we think light shoot out from that point.)

Input

     The first line is a positive integer T (1 <= T <= 55) which indicates the numbers of the test cases. Then flowing next T lines, there are two positive integer a, b (1 <= b<= a<= 10) in each line as a group of cases. 

Output

     The output of each case is one line with a positive integer which indicates the times of reflects. 

Sample Input

11 1

Sample Output

5

HINT

 

 The path of the light in the sample is looked as the picture shows. The light reflected five times.

 

Source

 

转载于:https://www.cnblogs.com/bofengyu/p/6790501.html

你可能感兴趣的文章
第一讲 一个简单的Qt程序分析
查看>>
Centos 6.5下的OPENJDK卸载和SUN的JDK安装、环境变量配置
查看>>
poj 1979 Red and Black(dfs)
查看>>
【.Net基础03】HttpWebRequest模拟浏览器登陆
查看>>
UML-画类图与交互图的顺序
查看>>
6月7 考试系统
查看>>
mysql 基本操作
查看>>
zTree async 动态参数处理
查看>>
Oracle学习之常见错误整理
查看>>
HTC Sensation G14开盒
查看>>
lock_sga引起的ksvcreate :process(m000) creation failed
查看>>
数据库插入数据乱码问题
查看>>
OVER(PARTITION BY)函数用法
查看>>
altium annotate 选项设置 complete existing packages
查看>>
【模式识别与机器学习】——SVM举例
查看>>
【转】IT名企面试:微软笔试题(1)
查看>>
IO流入门-第十章-DataInputStream_DataOutputStream
查看>>
DRF的分页
查看>>
html td 限制 高度 和 宽度
查看>>
mysql查询一个表的字段,添加或修改到另外一个表的数据
查看>>