Need help with a problem.
Please give me some hint to solve this problem: https://codeforces.me/gym/102769/problem/G