题解链接: https://www.luogu.com.cn/blog/LiveviL/solution-sp6717
hack:
16
1 2
2 3
3 4
4 5
2 6
6 7
7 8
1 9
1 10
10 11
11 12
12 13
10 14
14 15
15 16
输出:36