문제
Sweden may not have a particularly impressive mountain range compared to other NCPC countries such as Norway and Iceland, but at least it beats the flatlands of Denmark. The situation is not so clear when comparing other member countries though. For example, is Estonia more mountainous than Lithuania? To settle this question, you want to determine which of the two countries has the most impressive mountain peak.
A mountain range is defined by sampling the heights of equidistant points. Within a mountain range, we call a triple of indices a peak if . The height of a peak is defined as the smaller of and .
Given a mountain range, can you find the height of its highest peak?