Balance (Hard version)

Problem Name:
Balance (Hard version)
Site:CodeForces
Links:
Tags:
Problem setters: