This is the problem. This is my WA attempt.
What I am tying to do is first count how many maximum can be formed by x and x+1 each. Then, check if it is possible to decrease some amount of x+1 and increase some amount of x so that the overall answer increases. Please help me find where I am doing wrong?
I will be thankful for any help!
Here is a much simpler way :- https://mirror.codeforces.com/contest/1995/submission/272131540 Its pretty easy to understand too, but let me know if you dont get it :)
Thanks so much for reply!
I was looking to improve my incorrect solution. I went through editorial and found that they did something similar but their code is inaccessible.