编程介的小学生 2017-09-11 15:23 采纳率: 20.5%
浏览 661
已采纳

If it's a Javelin, Duck!

The coaches for the US Olympic Track Team, Pierre A. Noid and Ada Noid, fear that their 16-year-old, 7'2" javelin thrower, Moven van Driver, has not been given a "fair go" by the Olympic referees. They have purchased two distance measuring devices (DMD) to help them check on the accuracy of the measurements made by the referees. There are several elimination rounds for which each coach positions him/herself in either coaches area (which includes the boundaries), such that the two coaches are on opposite sides of the throwing zone. At the beginning of each round the coaches measure their separation from each other and the distance of each from the launching point. During a round the coaches do not move. For each throw in each round they record their distances from the landing point, and calculate the distance that should have been awarded to Moven. You may assume that the javelin will always land somewhere in the landing area (which includes its boundary).


The following measurements are made, as indicated in the figure above:

x Pierre's distance from the launching point
y Ada's distance from the launching point
z distance between Ada and Pierre
a Pierre's distance from the javelin's landing point.
c Ada's distance from the javelin's landing point.

Your program is to determine b, the actual distance traveled by the javelin (in meters, to the nearest hundredth of a meter) from the other measurements (given in meters to the nearest hundredth of a meter).

Input

There will be several groups of input data, each representing a round. The first line of each group will have an integer and three real numbers, n, x, y, and z separated by white space. The first number n is the number of throws in the current round, such that 0 <= n <= 5. The other distance limits are 10 <= x <= 100, 10 <= y <= 100, and 5 <= z <= 100. The next n lines will have pairs of real numbers, representing measurements a and c, such that 0 <= a <= 100, and 0 <= c <= 100. The input data is terminated by a value of n = 0, followed by three zeros, and this data is not processed.

Output

The output should be labeled by the number of the round, and followed by the distance of each throw for that round (each on a separate line). Formatting should be as in the sample output.

Sample Input

3 50.00 50.00 75.00
50.00 50.00
60.00 40.00
30.00 75.00
2 30.00 60.00 87.50
55.55 66.66
33.33 88.88
0 0 0 0

Sample Output

Round 1
1. 66.14
2. 66.30
3. 69.96

Round 2
1. 52.77
2. 48.81

  • 写回答

1条回答

  • threenewbee 2017-09-27 14:11
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)