Efficient algorithms for locating the length-constrained heaviest segments with applications to biomolecular sequence analysis