Can anyone help me with this problem? I tried to think about it for 2 straight days but cannot up with a solution. Also the editorial doesn't make sense.
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 4 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
| Name |
|---|



I solved this and wrote code with comments explaining it. Link to my AC code here I saw the editorial after solving and I agree it's a bit sparse on the details. Feel free to ask if any doubt.
Sir i still don't get ur solution I had this problem in my mind for 2 days but nothing comes to my mind. BTW sir do u think I can still be red If i am not able to solve this problem for now by next year.
Okay, this is definitely a troll. You don't really care about the solution. Hope this was not a complete waste of time and can help someone else in the future though.