Water-pouring algorithm
Water filling algorithm
Water-filling algorithm