the link of the problem: https://mirror.codeforces.com/gym/103102/problem/A
I guess I have known the general idea of this problem, but I don't know how to solve it practically。
I have read the tutorial, but I can't really understand it.
So I hope someone will share your thoughts on this problem.
Auto comment: topic has been updated by QuantumBolt (previous revision, new revision, compare).
https://mirror.codeforces.com/blog/entry/90956?#comment-794463 (ecnerwala)