Practice Contest
MEDIUM
You can view the editorial for this problem here.
Can be found here.
One of the worst problem statements ever