how to solve this kind of problem?
can anyone suggest approach to solve this problem? https://codeforces.me/gym/102157/problem/3
Mock ICPC Prelims Contest 1 Solution Discussion