<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def percentile(data, n):
 """Return the n-th percentile of the given data Assume that the data are already sorted """


    size = len(data)
    idx = (n / 100.0) * size - 0.5

    if idx < 0 or idx > size:
        raise StatisticsError("Too few data points ({}) for {}th percentile".format(size, n))

    return data[int(idx)]