Need help with proving greedy 1400

Revision en1, by Luckwet, 2025-07-15 23:03:18

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 :(

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Luckwet 2025-07-15 23:03:18 633 Initial revision (published)