P18163 [NWERC 2026] Long Shot
Description
You and your friends have signed up to play a many-versus-one tennis match against the famous professional player, Boris Feather. You have served the ball and he is about to return the shot.
A player with skill $s_i$ can defend a contiguous region centred on their position, exactly $s_i$ metres wide and covering the full depth of the court. If the ball lands in at least one of the regions defended by your players, they will be able to return it.
Although Boris' aim along the court (forward and backward) is perfect, his lateral (side to side) aim is only accurate to within $d$ metres. A shot aimed at lateral position $x$ will land at a uniform random point within the closed interval $[x - d, x + d]$. He never risks a ball missing the court, so the entire span of $[x - d, x + d]$ is always within the court boundaries of $[0, w]$.
Boris knows his accuracy $d$ and the positions and skills of all players on your team. He will always aim his shot so as to minimize your team's likelihood of success. Knowing this, you can arrange your team members on the receiving side of the court at arbitrary real coordinates.
What is the maximum achievable probability that your team will return the ball?
Input Format
The input consists of the following.
- One line with three integers $n$, $w$, and $d$ ($1 \leq n \leq 18$, $1 \leq 2 \cdot d \leq w \leq 10^9$), the number of players in your team, the width of the court, and the accuracy of Boris' shot.
- One line with $n$ integers $s_1, \dots, s_n$ ($1 \leq s_i \leq 10^9$ for each $i$), where $s_i$ is the skill of the $i$th player.
Output Format
Output the maximum achievable probability of returning a ball.
Your answer should have an absolute or relative error of at most $10^{-6}$.
Explanation/Hint
### Sample 2 Explanation

Illustration of Sample Input 2. The two players are positioned optimally and together control $70\%$ of the court, shaded in grey. Nonetheless, by aiming for the black interval, Boris ensures that you have only a $62.5\%$ chance of returning the ball.