Balanced Removals (Harder)

Problem Name:
Balanced Removals (Harder)
Site:CodeForces
Links:
Tags:
Problem setters: