Distribute the weights

Problem Name:
Distribute the weights
Site:HackerEarth
Links:
Tags: