编程介的小学生 2017-03-03 16:09 采纳率: 20.5%
浏览 824
已采纳

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

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-03-08 15:57
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝