• + 0 comments
    if __name__ == '__main__':
        n = int(input())
        student_marks = {}
        for _ in range(n):
            name, *line = input().split()
            scores = list(map(float, line))
            student_marks[name] = scores
        query_name = input()
    
    # initiate the accumulators to store total marks
    # and average scores
    total_marks = 0
    avg_score = 0
    # get each name in student marks
    for name in student_marks:
        # when name is equal to query name
        if name == query_name:
            # add the scores in the list for query student
            for score in student_marks[name]:
                total_marks += score
            # find its average
            avg_score = total_marks/len(student_marks[name])
    
    print("{:.2f}".format(avg_score))