# Catalyst Sequence - Indicative time limit: 5.0 seconds. - Judge time limit: twice the reference program’s largest per-case median on the target platform, rounded up to a multiple of 0.5 seconds. - Memory limit: 128 MB. - [Reference environment and measurements](../../../docs/评测环境与性能.md) ## Story An adventurer lines up crafting materials in the order they were obtained. The closer two energy values are, the lower the resulting catalyst’s separation level. For each level, find the longest consecutive batch of materials. ## Formal Problem Statement Given positive integers $a_1,\ldots,a_n$ , let $U=\max_i a_i$ . For a contiguous interval $[l,r]$ containing at least two elements, define its separation level as $$d(l,r)=\min_{l\le i