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.