There are 4 sorted list each of size 100, as n=400
f1 = 100 records
f2 = 100 records
f3 = 100 records
f4 = 100 records
Combining f1 and f2 needs 100 + 100 - 1 = 199 comparisons, in worst case.
Combining f3 and f4 needs 100 + 100 - 1 = 199 comparisons, in worst case.
Now we have two sorted & merged files each of size 200, hence we need 200 + 200 -1 = 399 comparisons to merge these files into one file of size 400.
hence total comparisons are required : 2*199 + 399 = 398 + 399 = 797
Note that using MERGE procedure, if there are two files, one with m records, and second with n records, need m+n-1 comparisons in worst case.