function [closestIndex, maxNumOfStcks] = findIdxOfClosestValue(numsOfSticks, targetValue)
closestValue = inf;

    for i = 1:length(numsOfSticks)
            actValue = abs(numsOfSticks(i) - targetValue);
            if actValue < closestValue
                closestIndex = i;
                maxNumOfStcks = targetValue - actValue;
                closestValue = actValue;
            end
    end
end