from typing import List
import math


def calculate_percentile(times: List[int], percent=0.95) -> int:
    """
    Calculate percentile (by default 95%) for sorted `times`.

    If we cannot choose one index, we use average of two nearest.
    """
    index = (len(times) - 1) * percent

    if index.is_integer():
        percentile_time = times[int(index)]
    else:
        left_part = times[math.floor(index)]
        right_part = times[math.ceil(index)]
        percentile_time = round((left_part + right_part) / 2)

    return percentile_time