The Boss of the Area of Support to the Decision Making of the FIB has a list with the IDN and the name of certain students of the UPC. On the other hand, he also has a list that enumerates the marks that some students of the UPC have had in certain subjects of certain centers. Both lists are sorted by IDN.
From these two lists, the boss wants to obtain efficiently a list that detaches the marks from each student, and the average of their marks. He has the program started (see lstlisting attached) and he has asked you to finish it.
The input consists of two lists, each one sorted by IDN and without repeated lines. The lstlisting that defines the data structs and the code that reads the input is already done. Do not modify it!
The output is a list sorted by the IDNs that contains, for each student, his marks and the average of them. The marks must appear in the same order than in the second input list.
Notice that, for each student, you must separate with five white spaces the information of his marks, and then, you must print an empty line. Notice also that if an identifier appears in an input list but it does not appear in the other one, it has not to appear in the output list.
5 1312 Charlotte 5561 Natalie 7790 Laura 8876 Smith 9386 Martin 7 1312 P1 FIB 7 1312 AL FIB 8 2020 IC FIB 4.8 5561 P1 FIB 0 5561 I1 FME 6.5 7790 P1 FIB 10 9386 I1 FME 10
1312 Charlotte P1 FIB 7.00 AL FIB 8.00 average: 7.50 5561 Natalie P1 FIB 0.00 I1 FME 6.50 average: 3.25 7790 Laura P1 FIB 10.00 average: 10.00 9386 Martin I1 FME 10.00 average: 10.00
1 123456789 Mary 1 987654321 P1 FIB 5