这两个问题都是卡满上界的,非常深刻。
https://codeforces.com/contest/1365/problem/G
https://codeforces.com/contest/1705/problem/F