the link of the problem: https://codeforces.net/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://codeforces.net/blog/entry/90956?#comment-794463 (ecnerwala)