Problem link https://codeforces.me/contest/615/problem/D
My Submission https://codeforces.me/contest/615/submission/78009885
Can anyone please tell why my submission is getting WA . I have read the editorial and got the solution but i would like to know why this approach is not working. I am trying this for a long time and have no clue. Please help!!