For fixed integers $T\geq G>1$, we say a list $[a_1, a_2,\cdots, a_n]$ is normal if every consecutive sublist $[a_i, a_{i+1}, \cdots a_{i+T-1}]$ of length $T$ has less than $G$ maximal elements.
Given a list $[a_1, a_2,\cdots, a_n]$ of $N$ numbers between $1$ and $30$ inclusive, suppose that by adding one to the $i^\text{th}$ element of the list we call this an operation. If we may only operate on a particular element once, how can we find the minimal number of operations needed to make this list normal?
Some examples for illustration:
If $T=G=2$, then from the list $[1, 2, 3, 4, 5]$ we are considering the four sublists $[1,2]; [2,3]; [3,4];$ and $[4,5]$. The maximal elements of these sublists are $2,3,4,$ and $5$, respectively. Since none of these are repeated, each occurs less than twice in its respective sublist, and so it is normal.Thus ,for this case the minimum number of operations required to make the list normal are 0.
If $N=5$, $T=3$ and $G=3$, and the list is $[7,7,7,7,7]$, we are considering the sublists $[7,7,7] ; [7,7,7] ;$ and $[7,7,7]$. Initially, the list violates the property that maximum element should be less than $G=3$ times in each sublist. However, if we operate on the third element, the list becomes $[7,7,8,7,7]$, which is normal. (The sublists are $[7,7,8] ; [7,8,7];$ and $[8,7,7]$, and the maximum element of each sublist is $8$ and is present less than three times in that sublist.) Thus ,for this case the minimum number of operations required to make the list normal are 1.