def global_accuracy(task_accuracies, test_samples_per_task):
    """
    Calculate global accuracy of the model based on accuracies from single tasks accounting number of test samples per task.

    :param task_accuracies: list of accuracies for each task
    :param test_samples_per_task: list of test samples for each task
    :return: total/global accuracy in %
    """
    accurate_samples = sum([round((task_acc / 100) * task_samples) for task_acc, task_samples in zip(task_accuracies, test_samples_per_task)])
    return (accurate_samples / sum(test_samples_per_task)) * 100