Can there be a faster solution for this !!! ???
For the given question Question
Editorial solution
Codeforces Round 953 Div 2 Solution Discussion (with Jan)