1655. Planet Destruction

时间限制 1000 ms   内存限制 128 MB

Darth Vader is back to his favourite hobby: destroying planets (or their population to be precise). He just discovered that the rebel leadership has gathered at a planet named Watooine, so he must act quickly to eliminate the threat. Unfortunately, the Empire is in a pretty bad recession right now, so there aren't any Death Stars left around. Therefore, Vader's plan involves dropping several containers with deadly viruses onto the planet's surface.

To make things simpler for you, we will model this problem in 2D. Watooine has radius R and is centred at (0,0). There are K Empire spaceships, each of which will simultaneously launch a rocket with a container towards point (0, 0). Once the rocket hits the surface of the planet, a virus will start spreading along the surface in the shape of a circle of ever increasing radius. Since we are modelling the problem in 2D, the virus spreads from the point of impact at the same rate in both directions, clockwise and counterclockwise along the circumference of the circle that represents the surface of the planet. Each spaceship has a custom rocket speed, and each virus has a custom spread speed. Note that each virus spreads along the surface of the planet - it cannot pass through the planet to reach the other end.

Your task is to determine how much time will it take for Watooine to become completely infected - i.e. every point on the planet surface has been reached by a virus. Good luck!


输入数据

The first line contains T, the number of test cases, followed by the descriptions of the T test cases. Each test case description has the following structure: The first line contains two integers R, the radius of the planet (in meters), and K, the number of spaceships. The next K lines each contain 4 integers: the X-coordinate of the ship, the Y-coordinate of the ship, the rocket speed and the virus spread speed (in meters per second). It is guaranteed that no ships are inside the planet.

Both speeds are between 1 and 1000000, both coordinates are between -1000000 and 1000000, R is between 1 and 1000000. K is between 1 and 10000, and T is between 1 and 100.


输出数据

For each test case, print one line containing one real number, the time it takes for the planet to become completely infected. Your answer will be considered correct if it is within 10-4 from the jury answer.


样例输入

复制
1
100 1
200 0 10 7
 \n
   · \n
   · ·  · \n

样例输出 special judge

复制
54.8798950513
             \n

提交

请先 登录

Source

Volodymyr Lyubinets

© 2024 FAQs Contact About