cho.sh
Notes
Loading...

Tower Attack

Time limit

2s

Memory limit

128 MB

Problem

A city has N defense towers on an X-Y coordinate plane. Every tower initially has D energy, and every tower has range R. An enemy is located at (X, Y).

Before attacking, towers may redistribute energy. If the distance between two different towers is at most R, one of them may send any amount of its current energy to the other. During a transfer, half of the sent energy is lost: when a tower sends 10 energy, it loses 10 energy and the receiving tower gains 5 energy.

A tower can attack the enemy if its distance from the enemy is at most R. When a tower attacks, it uses all energy it currently has, and the enemy receives damage equal to that energy. If several towers can attack, their damage is added together.

Compute the maximum total damage that can be dealt to the enemy after redistributing energy optimally.

Input

The first line contains five integers N, R, D, X, and Y: the number of towers, the range, the initial energy of each tower, and the enemy's coordinates.

Each of the next N lines contains two integers, the X-coordinate and Y-coordinate of one tower.

N is a positive integer at most 50. R is a positive integer at most 500, and D is a positive integer at most 100. Every coordinate is a nonnegative integer at most 1000. No two towers share the same position, and no tower is located at the enemy's position.

Output

Print the maximum damage the enemy can receive. An absolute or relative error of at most 10^-2 is accepted.

Hint

Energy transfer is linear: if a tower is k transfers away from the nearest tower that can attack, its initial energy can contribute at most D / 2^k damage.