Need help to understand the problem statement.
Problem link: https://codeforces.me/contest/1102/problem/B