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

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条回答

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog