def get_results(combinations, config_dict):
    """
    This function finds for each mission its most resilient configuration and probability.

    :param combinations: dictionary which contains for each mission its configurations
    :param config_dict: dictionary which contains for each configuration and goal host
    the inferred probabilities (C, I, A)
    :return: dictionary which contains for each mission only its most resilient configuration
    and probability
    """
    result_dict = {}
    for mission in combinations:
        result_dict[mission] = {}
        for index in config_dict[mission]:
            partial_result = {}
            for host in config_dict[mission][index]:
                if "probability" not in partial_result or \
                        sum(config_dict[mission][index][host]['result']) > \
                                sum(partial_result["probability"]):
                    partial_result["configuration"] = combinations[mission][index]
                    partial_result["probability"] = config_dict[mission][index][host]['result']
            if "probability" not in result_dict[mission] or \
                    sum(partial_result["probability"]) < sum(result_dict[mission]["probability"]):
                result_dict[mission]['configuration'] = partial_result["configuration"]
                result_dict[mission]["probability"] = partial_result["probability"]
    return result_dict