Let $a_0,a_1,\ldots,a_n,a_{n+1}$ be a finite sequence of real numbers satisfying $a_0=a_{n+1}=0$ and
$$|a_{k-1}-2a_k+a_{k+1}|\le1.$$
Prove that
$$a_k\le\frac{k(n+1-k)}2\qquad(k=0,1,\ldots,n+1).$$
An $m$-sided polygon $(P)$ and an $n$-sided polygon $(P')$ lie in two parallel planes. Consider the family of segments $AA'$ with $A$ and $A'$ lying on sides of $(P)$ and $(P')$, respectively. Explain how to find:
(a) a shortest segment $AA'$;
(b) a longest segment $AA'$.