Hello,
https://mirror.codeforces.com/problemset/problem/1037/D
This is the problem statement, I have read article and editorial too but not getting why my approach is wrong. Solution : https://mirror.codeforces.com/contest/1037/submission/90667456
Thanks in advance..!!!