Hackerrank: Filling jars
https://www.hackerrank.com/challenges/filling-jars