https://codeforces.me/contest/2033/problem/C
I tried to solve this problem and didn't come up with anything good, except a huge non-working solution. I looked at Editorial — I still didn't understand. I went to ask ChatGPT — I still didn't understand, it was written too briefly. I spent 5 hours and only came to an "intuitive" understanding, where I agree with the facts because I can't find a counterexample, but not because it has been proven that the opposite does not exist.
Please help me prove this greedy. I can't come to terms with it until I fully understand it :(



