编程介的小学生 2017-04-26 08:07 采纳率: 20.5%
浏览 732
已采纳

Platform

A huge circular platform with radius r was built recently to provide tourists with a better view of the lake beside it. Due to a design defect, the platform has only one entrance and one exit. It often gets quite crouded as many tourists are quite impressed by the beautiful scenery and take photos. Walking across the platfrom is often quite an uneasy task because when others are taking photos, you can't just simply walk in front of them and have to wait until they put down their cameras.
A tourist (let's just call him Tom) has just entered the platform and notices that many photographers are taking photos for tourists. He hates crowded place and wishes to leave as soon as possible. You should help him.

The platform of radius r is placed with its center at (0, 0). It's entrance is at (0, -r) while the exit at (0, r). All photographers and tourists are inside or on the border of the platform. Each photographer is taking a photo for exactly one tourist. Tom may never walk between a photographer and the corresponding tourist, nor could he walk behind that tourist, as shown below.

Input

The input has several cases. Each case begins with r and n, the number of photographers (n <= 1000). n lines follow, each contains 4 real numbers followed by an integer. The first two real numbers are the coordinates of the photographer. The next two numbers are the coordinates of the corresponding tourist. The integer is the time that they finish taking photos. Time starts form 0. Input is terminated by EOF.

Output

For each test case, output a line with the minimal time Tom has to wait.

Sample Input

10 2
0 0 1 0 1
1 -1 0 1 2

Sample Output

1

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-05-10 15:57
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?