Barges and Heaps, first working version

First problem in http://ce.azc.uam.mx/profesores/franz/acm/problems2012.pdf