#P4288. [SHOI2014] 信号增幅仪

[SHOI2014] 信号增幅仪

Description

In ideal conditions, the effective coverage area of a wireless base station is a circle, and the power consumption is proportional to the square of the circle’s radius. Given the positions of several network users on the plane, you are to choose a suitable location to build a wireless base station...

Just as you are about to start coding, your good friend, the inventor SHTSC, shows up. SHTSC has just completed his new invention — a wireless signal amplifier. Without increasing the base station’s power consumption, the amplifier can extend the effective signal coverage by a certain multiple in a specific direction. That is, a base station using the amplifier has an elliptical coverage area, and its power consumption is proportional to the square of the length of the semi-minor axis.

Given the positions of several network users on the plane, choose a suitable location to build a base station and, with the help of the amplifier, ensure that all users can receive the signal while minimizing the base station’s power consumption.

Note: Because the working principle of SHTSC’s amplifier depends on the geomagnetic field, the amplification direction is fixed.

Input Format

The first line contains an integer n, the number of users on the plane. The next n lines each contain two integers x, y, representing a user’s position.

The (n+2)-th line contains an integer a, representing the amplifier’s direction in degrees. It is measured counterclockwise from the positive x-axis.

The (n+3)-th line contains an integer p, representing the amplifier’s magnification factor.

Output Format

Output a single real number: the length of the semi-minor axis of the smallest ellipse that can cover all users, rounded to three decimal places.

2
1 0
-1 0
0
2
0.500
3
1 1
-1 -1
0 0
45
7
0.202

Hint

  • For 10% of the testdata, it is guaranteed that the optimal center is at the origin.
  • For 20% of the testdata, the points are randomly generated.
  • For 30% of the testdata, n100n \le 100.
  • For 50% of the testdata, n5000n \le 5000.
  • For 100% of the testdata, n50000n \le 50000, 0a<1800 \le a < 180, 1p1001 \le p \le 100, x,y|x|, |y| \le 2×1082×10^8.

Translated by ChatGPT 5