| 2019-2020 ICPC, Moscow Subregional |
|---|
| Закончено |
Min and Max have a continuous piecewise linear function $$$f(x)$$$. The function $$$f(x)$$$ is defined on the segment $$$[0, n]$$$ as follows:
Min and Max are playing a game. Before the game starts they choose two positive real parameters $$$A$$$ and $$$\varepsilon$$$. There is a counter $$$T$$$ initially equal to $$$A$$$. Before the game starts, Max chooses an arbitrary real number $$$x \in [0, n]$$$. Players then proceed to take turns starting from Min. During a player's turn:
When the game is over, the result of the game is equal to $$$f(x)$$$. Min wants to minimize the result, while Max wants to maximize it.
Let $$$R(A, \varepsilon)$$$ be the result of the game with parameters $$$A$$$ and $$$\varepsilon$$$ if both players play optimally. Compute $$$\displaystyle \lim_{\varepsilon \to 0} R(A, \varepsilon)$$$. It is guaranteed that this limit exists.
The first line contains two integers $$$n$$$ and $$$A$$$ ($$$1 \leq A \leq n \leq 100\,000$$$).
The second line contains $$$n + 1$$$ integers $$$a_0, \ldots, a_n$$$ ($$$-10^6 \leq a_i \leq 10^6$$$).
Print a single real number $$$\displaystyle \lim_{\varepsilon \to 0} R(A, \varepsilon)$$$. Your answer will be accepted if its absolute or relative error does not exceed $$$10^{-4}$$$.
1 1 0 1
0.5000000000
2 1 0 2 1
1.4285714283
| Название |
|---|


