Balancing cubes

Problem Name:
Balancing cubes
Site:HackerEarth
Links:
Tags:
Problem setters: