https://www.luogu.org/problemnew/show/P5348
题解链接:https://www.cnblogs.com/cj-xxz/p/10812358.html
注意几个结论: