编程介的小学生 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 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘