compute segment len distr