Hello, everyone! It was a delight for us to have you participate in our contest. We hope you enjoyed the problems! Here, we present to you the solutions of the problems. Firstly, here are some comments about the contest:
Mid-contest, a contestant pointed out that F was the same as A in this contest. We're sorry, it was an unfortunate coincidence, and none of the setters/testers/coordinators had seen it elsewhere. Luckily, it did not affect Div-2 standings considering its difficulty, and we'll be more careful next time.
I will add stats and first-solvers for each problem as system testing happens.
Code for A