Help me out in this problem

https://cses.fi/problemset/task/1637

what problem are you facing in this question? please share your approach