def get_segment_coordinates(center, segment_length, sequence_length):
    """Return max(0, c - s/2) - min(L, c + L/2).

    Where c=center, s=segment_length, L=sequence_length.
    """
    half = int(segment_length / 2)
    start = max(0, min(center - half, sequence_length - segment_length))
    end = start + segment_length
    return start, end
