This problem: https://mirror.codeforces.com/gym/106160/problem/B has an editorial (it's a pdf attached) and they claim: 
But to me the relationship should be:
$$$f(i, x) = cost(i, x) + min_{y ≤ x} f(i-1, y)$$$ where $$$cost(i, x)$$$ is either 0, 1, or 2.
Definitely have no idea where the max could come from.
Would love to have someone double check if what I'm claiming is true or if I'm just dumb and misreading the editorial.








