Problem

Source: 2016 Korea Winter Camp 2nd Test #8

Tags: combinatorics



Let $a_1, a_2, \cdots a_{100}$ be a permutation of $1,2,\cdots 100$. Define $l(k)$ as the maximum $m$ such that there exists $i_1, i_2 \cdots i_m$ such that $a_{i_1} > a_{i_2} > \cdots > a_{i_m}$ or $a_{i_1} < a_{i_2} < \cdots < a_{i_m}$, where $i_1=k$ and $i_1<i_2< \cdots <i_m$ Find the minimum possible value for $\sum_{i=1}^{100} l(i)$.