编程介的小学生 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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮