import re


def read_best_values(file_list):
    """Reads the best hypervolume values from files in file_list, where each is formatted as a C source file
       (starts to read in the next line from the first encountered 'static').
       Returns a dictionary containing problem names and their best known hypervolume values.
       :param file_list: list of file names
    """
    result = {}
    for file_name in file_list:
        read = False
        with open(file_name, 'r') as f:
            for line in f:
                if read:
                    if line[0:2] == '};':
                        break
                    split = re.split(',|\"|\t| |\n', line)
                    entries = [item for item in split if item]
                    result.update({entries[0]: entries[1]})
                elif line[0:6] == 'static':
                    read = True
            f.close()

    return result