Dynamically calculate the perfect column count for each row for given col-count, target and min colums.