def appropriate_partition(distance):
    """Find appropriate partition of a distance into parts.

    Parameters
    ----------
    distance : float
        Traveled distance in meters

    Returns
    -------
    segment_distance : float
        Appropriate length of segments in which we split the total distance
    """
    if distance < 5000:
        return 400
    elif distance < 20000:
        return 1000
    elif distance < 40000:
        return 2000
    elif distance < 100000:
        return 5000
    else:
        return 10000