编程介的小学生 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 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿