Orac and Medians
HardRating 2000CodeforcesConstructive Algorithms
Approach hintTry it first, then revealHide
If k is absent, nothing works. Otherwise, once two values >= k sit within distance 2 of each other, a length-2 or length-3 median can spread k everywhere; check for such a pair and handle n = 1 separately.