编程介的小学生 2017-08-23 02:27 采纳率: 20.5%
浏览 680
已采纳

Pie Bridge

It is the Valentine's day! Yue Lao decides to have a meeting for the magpies to construct the pie bridge(magpie bridge). There are N magpies in the sky. In order to hold a meeting, Yue Lao should make all the magpies at the same place in the same time.

A magpie can be consider as a dot in the 2d-plane. Initially, all the magpies stay still in some place. The only instruction Yue Lao can do is to push a magpie. Yue Lao can push a magpie in any direction. After Yue Lao pushs a magpie, the magpie starts moving in that direction with a constant speed. Yue Lao's power is limited, so there is a limit for the speed of the magpie: the horizontal speed can't exceed vx and the vertical speed can't exceed vy.

Yue Lao can push a magpie at most once. Besides, Yue Lao can't push magpies too often. After a push, he needs to rest at least t seconds for the next push. When two magpies meet at the same point, they will not collide with each other and will stay moving or stay still.

Now the question is, what is the minumum time it needs to take for Yue Lao to achieve his goal (make all the magpies moves to the same place at the same time)?

Input

There are multiple test cases. There are two parts for each case. The first part is one line with four integers N, vx, vy and t (2 <= N <= 9, 0 < vx, vy <= 100, 0 <= t <= 100), represent the number of magpies, the horizontal speed limit, the vertical speed limit, and the time interval Yue Lao needs to rest between two pushes. The second part consists with N lines. Each line consists of two integers xi and yi (-1000000 <= xi, yi <= 1000000), represent the coordinate for the ith magpie. There will not be two different magpies in the same point initially.

Output

The output of each test case should be a single line, the minimum time for Yue Lao to achieve his goal. All result that have relative or absolute error less than 1E-6 will be accepted.

Sample Input

2 1 1 1
0 0
0 7
Sample Output

4.000000000000000

  • 写回答

2条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)