def get_predicate_indices(predicate, inverted):
    """
    Gets the indices of the predicate's input and output.

    :param predicate: the predicate
    :type predicate: Predicate
    :param inverted: if the predicate is inverted
    :type inverted: bool
    :return: the input and output indices
    :rtype: (list[int], int)
    """
    if predicate.arity == 1:
        input_index = [0]
        output_index = 0
    elif predicate.arity == 2:
        if inverted:
            input_index = [1]
            output_index = 0
        else:
            input_index = [0]
            output_index = 1
    else:
        input_index = [x for x in range(predicate.arity - 1)]
        output_index = predicate.arity - 1

    return input_index, output_index