def percentile_s(p, sorted_seq):
    """Return percentile `p` of `sorted_seq`.

    >>> l1 = [3, 6, 7, 8, 8,    10, 13, 15, 16, 20]
    >>> l2 = [3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20]
    >>> for l in (l1, l2) :
    ...   for p in (0, 25, 50, 75, 100) :
    ...     print ("%3s percentile of %s elements: %2s" % (p, len (l), percentile (p, l)))
      0 percentile of 10 elements:  3
     25 percentile of 10 elements:  7
     50 percentile of 10 elements:  8
     75 percentile of 10 elements: 15
    100 percentile of 10 elements: 20
      0 percentile of 11 elements:  3
     25 percentile of 11 elements:  7
     50 percentile of 11 elements:  9
     75 percentile of 11 elements: 15
    100 percentile of 11 elements: 20

    """
    l = len(sorted_seq)
    i = int(0.99 + p * l / 100) - 1 if p else 0
    result = sorted_seq[i]
    return result
