import math


def compute_salary_scores(tree):
    """
    Computes some scores related to salary

        :param tree: data from which compute the score
        :return: two values corresponding to salary scores, or NaN if they cannot be computed
    """
    charges = tree['children']['ResultatAvantImpot']['children']['ResultatExploitation']['children']['ChargesExploitation']

    cotisations_sociales = charges['children']['ChargesSociales']['data']['value']
    salaires = charges['children']['SalairesEtTraitements']['data']['value']

    salary_level = float('nan')
    salary_percent = float('nan')
    if not any(math.isnan(value) for value in [cotisations_sociales, salaires]) and salaires > 0:
        salary_level = cotisations_sociales / salaires
        if not math.isnan(charges['data']['value']):
            salary_percent = (cotisations_sociales + salaires) / charges['data']['value']

    return salary_level, salary_percent