import operator


def multiply_round(n_data: int, cfg: dict):
    """
    Given a configuration {split: percentage}, return a configuration {split: n} such that
    the sum of all is equal to n_data
    """
    print(cfg)
    s_total = sum(cfg.values())
    sizes = {name: int(s * n_data / s_total) for name, s in cfg.items()}

    max_name = max(sizes.items(), key=operator.itemgetter(1))[0]
    sizes[max_name] += n_data - sum(sizes.values())

    return sizes