A. Desorting | Codeforces Round 887 | Solution Code In Comment.

Click a thumbnail to watch in a lightweight modal. (No downloads — view only.)