Hii…
I am doing this question from codeforces…
https://codeforces.com/contest/1453/problem/B
I am solving this by looking at the editorial… as i was not able to solve it in contest.
I have done almost same thing as mentioned in the editorial.
But don’t know why it is showing wrong answer.
Please look at this.
Thanks