Program to prune the leaves if sum is less than k