How can I understand a hint for finding the lowest height of the last bulb in a Garland?
Short answer

Let $d=h_1-h_2$. Do a binary search for the largest value of $d$ in interval $[0,A]$ so that none of $n$ bulbs in the garland will be lower than the ground. The wanted minimum value of the second endpoint $B$ corresponds to the case when $d$ is that largest value.

Explanation

The question is how to understand the hint "you can use binary search".

Before understanding the hint, we are supposed to have understood what is binary search. Binary search is a search algorithm that finds the position of a target value within a sorted array or an interval.

So, what could be that target value we are supposed to search? Within which sorted array or which interval? 


The most obvious target value to search is $m$, the minimal value of $B$. We could search $m$ within the interval $[0, \text{FM}]$, where $\text{FM}$ is the maximum value of a floating-point number. 
Another obvious target to search is about that lowest bulb. In case there are two lowest bulbs, the lowest bulb will mean the one to the left. The further to the right the lowest bulb is, the lower value $B$ is. We could search $\ell$, the rightmost possible position of the lowest bulb within the interval $[0,n]$.


Whenever we started to compute, we find we have to understand clearly the given equality, $\displaystyle h_i=\frac{h_{i-1}+h_{i+1}}2-1.$ If $h_1=A$ and $h_2$ are known, the height of every bulb is fixed, since 
$$h_{3}=2\times h_{2}-h_{1}+2$$ 
$$h_{4}=2\times h_{3}-h_{2}+2$$ 
$$\cdots$$

The only requirement is that no bulb can be lower than the ground. Note that 

$$\displaystyle h_{i+1}-h_i=h_{i}-h_{i-1}+2.$$

As we visit the bulb from left to right, the bulb is dropping less and less between each pair of successive bulbs initially. Once the bulb have reached the lowest level, it will climb more and more between each pair of success bulbs.   The larger the first drop $h_1-h_2$ is, the more likely one of the $n$ bulbs will hit the ground and the lower the last $B$ will be. Aha, we can also search the largest value of $h_1-h_2$ within interval $[0, A]$.


How to binary search a real number?

How can we search for the largest value of $d$, which is a real number in an interval?

Since there are infinitely many real number in an interval, checking equality is not likely to work as the stopping condition. That is why we are given the requirement for the "the minimal height of the second endpoint" that it differs from the right one by at most $10^{−6}$". The pseudocode looks like the following. 

'''A=h_1, n are given.'''

'''10^(-7) instead of 10^(-6) to guard against rounding errors in computation of floating-point numbers'''
precision = 10^(-7)   

function get_largest_first_drop_by_binary_search():
    L = 0
    R = A
    B_L = last_height(L)
    B_R = last_height(R)
    while ( B_L - B_R &gt; precision):
        m = (L + R) / 2.0
        if hit_ground(m):
           R = m
           B_R = last_height(R) 
        else:
           L = m
           B_L = last_height(L)
    return B_L


function last_height(d):
    ''' Given first drop h_2 - h_1 = d, return h_n, the height of last bulb'''
    return A + ((-d)+(-d+2(n-2)))(n-1) / 2

function hit_ground(d):
    ''' Given first drop h_2 - h_1 = d, return true iff the garland will hit the ground '''
    k = floor(d/2) + 2
    if k &gt;= n return last_height(d) &lt; 0
    if k &lt; n return A + ((-d)+(-d+2(k-2)))(k-1) / 2 &lt; 0
    return false


Implementation

Here is an implementation in Java. Click the run button to see the result.

Exercise

Show that the minimum value of the second endpoint $B$ is 0 if and only if $A \ge (n-1)(n-2)$.