题解 https://www.luogu.com.cn/article/66yb8p8x 有误。
hack:
in: 30 5 2 2 5 2 4 5 2 4 5 2 3 1 5 1 1 5 3 3 1 3 2 1 1 2 5 3 2 1 2 3 ans: 23 out: 24