Hide

Problem H
Cat Fight

The Djingis Khan neighborhood in Lund is home to many cats, each of which has a defined territory with a certain radius, centered around their home at point $(x, y)$. In Djingis Khan it appears that all cats with the same gender have the same radius of their territory. Male cats have territories with radius $R_ M$ and female cats have territories with radius $R_ F$.

When two cats’ territories overlap, they engage in a fight. The intensity of the altercation is proportional to the size of the overlapping area. What is the maximum area of overlap between two cat territories?

Input

The first line has three space-separated numbers, the first of which is an integer $2 \leq N \leq 200\, 000 $, the number of cats. The following two numbers are the radii $R_ F$ and $R_ M$ respectively ($0 \leq R_ F, R_ M \leq 10\, 000$). $R_ F$ and $R_ M$ are decimal numbers with exactly 6 digits after the decimal point.

Each of the following $N$ lines consist of a single character $g_ i$ followed by a pair of space-separated integers $x_ i$ and $y_ i$ ($-10^9 \leq x_ i, y_ i \leq 10^9$). $g_ i$ is either “M” or “F” depending on whether cat number $i$ is male or female, and $x_ i$ and $y_ i$ describe the x- and y-coordinates of the home of cat number $i$.

Output

A single number, the size of the biggest overlapping area between two territories.

Your answer should have an absolute or relative error of at most $10^{-5}$.

Scoring

Group

Points

Limits

1

24

$N \leq 1\, 000$ and $R_ F = R_ M$

1

23

$N \leq 1\, 000$

1

31

$R_ F = R_ M$

2

22

No further restrictions

Sample Explanation

\includegraphics[width=0.6\textwidth ]{./img/sample1.png}
Illustration of the territories in sample 1.

Sample Input 1 Sample Output 1
3 2.000000 2.000000
M 0 2
F 1 2
F 3 1
8.608436900119

Please log in to submit a solution to this problem

Log in