CF73F.Plane of Tanks

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Vasya plays the Plane of Tanks. The tanks in this game keep trying to finish each other off. But your "Pedalny" is not like that... He just needs to drive in a straight line from point AA to point B on the plane. Unfortunately, on the same plane are nn enemy tanks. We shall regard all the tanks as points. At the initial moment of time Pedalny is at the point AA . Enemy tanks would be happy to destroy it immediately, but initially their turrets are tuned in other directions. Specifically, for each tank we know the initial rotation of the turret aia_{i} (the angle in radians relative to the OXOX axis in the counterclockwise direction) and the maximum speed of rotation of the turret wiw_{i} (radians per second). If at any point of time a tank turret will be aimed precisely at the tank Pedalny, then the enemy fires and it never misses. Pedalny can endure no more than kk shots. Gun reloading takes very much time, so we can assume that every enemy will produce no more than one shot. Your task is to determine what minimum speed of vv Pedalny must have to get to the point BB . It is believed that Pedalny is able to instantly develop the speed of vv , and the first kk shots at him do not reduce the speed and do not change the coordinates of the tank.

输入格式

The first line contains 4 numbers – the coordinates of points AA and BB (in meters), the points do not coincide. On the second line number nn is given ( 1<=n<=1041<=n<=10^{4} ). It is the number of enemy tanks. Each of the following nn lines contain the coordinates of a corresponding tank xi,yix_{i},y_{i} and its parameters aia_{i} and wiw_{i} ( 0<=ai<=2π0<=a_{i}<=2π , 0<=wi<=1000<=w_{i}<=100 ). Numbers aia_{i} and wiw_{i} contain at most 5 digits after the decimal point. All coordinates are integers and their absolute values do not exceed 10510^{5} . Enemy tanks can rotate a turret in the clockwise as well as in the counterclockwise direction at the angular speed of not more than wiw_{i} . It is guaranteed that each of the enemy tanks will need at least 0.10.1 seconds to aim at any point of the segment ABAB and each of the enemy tanks is posistioned no closer than 0.10.1 meters to line ABAB . On the last line is given the number kk ( 0<=k<=n0<=k<=n ).

输出格式

Print a single number with absolute or relative error no more than 10410^{-4} — the minimum required speed of Pedalny in meters per second.

输入输出样例

  • 输入#1

    0 0 10 0
    1
    5 -5 4.71238 1
    0
    

    输出#1

    4.2441
    
  • 输入#2

    0 0 10 0
    1
    5 -5 4.71238 1
    1
    

    输出#2

    0.0000
    
首页