Vampire Basketball
InterviewTime limit2sMemory limit1024 MB
Sort Edward's teammates by a shot favorability score that drops with the defenders within distance l, and print their jersey numbers.
- Level
Medium4 of 10
- Topics
- Sorting, Math, Implementation
- Solved
- No attempts yet
Hint

The picture shows an example. , , .
Note that the hoop is a point.
Problem
Vampires love sports and are good at them. It is autumn, and playing baseball outside is too chilly, so the vampires decided to play basketball in the gym. As soon as they arrive, they split into two teams. Edward always plays point guard because he likes to make passes. For each lineup, he wants to know which of his teammates are in the most favorable position and which are not.
The court is a half-plane. Every point has integer coordinates and with . The hoop is at . The three-point arc is a semicircle with radius centered at the hoop. If a player's distance to the hoop is strictly greater than , a made shot is worth three points, otherwise two. Edward knows that all players on his team shoot the same way. Each opponent has a defensive skill, given as a natural number.
Each vampire wears a jersey with a number. Numbers within a team are distinct and consecutive. For example, if Edward's team has three vampires and the opponents have two, their numbers are 1, 2, 3 and 1, 2. Edward wears jersey number 0, and his own position does not matter to him.
Edward rates the favorability of teammate with the formula
where is the number of points a shot from that spot is worth, is the distance from the vampire to the hoop, and is the sum of the defensive skills of the opponents whose distance to the attacker does not exceed .
To help Edward, print the jersey numbers of his teammates in decreasing order of favorability. If two favorability values are equal, the smaller number comes first.
Input
The first line contains , , , (, ): the number of vampires on Edward's team, the number of opponents, the radius of the three-point arc, and the distance within which defenders affect players.
The next lines contain the coordinates and of Edward's teammates in jersey number order (, ). The next lines contain the coordinates and of the opponents in jersey number order (same bounds), followed by (), the defensive skill of opponent .
All player positions are distinct.
Output
Print numbers: the jersey numbers of Edward's teammates in the required order.