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