Problem E of yesterdays contest
Can anyone explain me how binary search will lead to answer.
https://codeforces.com/problemset/problem/1100/E