Disclaimer This is not from an ongoing contest, this is from my course on edx of ITMO. Also this is a paid courses so the direct link to the problem is not useful unless you also register this course.
Problem description A garland consists of light bulbs hanging from the same wire. One endpoint of this wire is fixed at a height of $A$ millimeters ($h_1 = A$. Thanks to gravity, the garland bends down: the height of every light bulb which is not at the endpoint is one millimeter smaller than the average height of its neighbors: ($\displaystyle h_i=\frac{h_{i-1}+h_{i+1}}2-1$ for $1 < i < n$).
Determine the smallest height of the second endpoint $B$ ($B= h_n$), given that at most one light bulb is allowed to touch the ground, and for all other light bulbs the inequality ($h_i$ > 0) should be true.
Hint: to solve this problem, you can use binary search.
Input
The first line of the input file contains two numbers $n$ and $A. 3 \le n
\le 1000$, $n$ is an integer, $10 \le A \le 10000$, $A$ is a floating-point number which has at most three digits after the decimal point.
Output
Print a single number $B$ , which is the minimal height of the second endpoint. Your answer is considered to be correct if it differs from the right one by at most $10^{-6}$.
Examples
$\displaystyle\begin{array}{|l|l|} \hline \text{input.txt} & \text{ output.txt} \\\hline 8\ \,15 & 9.75 \\\hline 692\ \,532.81 & 446113.34434782615 \\\hline \end{array}$
There are problems that you either get it or don't, this is the "don't get it" for me. I cannot correlate the hint to the solution. I mean what we are supposed to search, although I can understand the problem but it's like the hint is the ambiguity for me. Without the hint, I don't know how to proceed, either.