function partition(k, l) {
  var m = k + 1,
      a = (l / m) | 0,
      b = a + 1,
      i,
      j;

  var largeSegments = l - a * m,
      smallSegments = m - largeSegments;

  var tuples = new Array(k + 1);

  for (i = 0; i < smallSegments; i++)
    tuples[i] = [i * a, a];

  var offset = (i - 1) * a + a;

  for (j = 0; j < largeSegments; j++)
    tuples[i + j] = [offset + j * b, b];

  return tuples;
}
Function partitioning a string into k + 1 uneven segments, the shorter
ones, then the longer ones.

@param   {number} k - Levenshtein distance threshold.
@param   {number} l - Length of the string.
@returns {Array}    - The partition tuples (start, length).