Use a linked list of file sizes, initially holding the given data in non-decreasing order. Also, initialize a pointer to the head of the list. Iterate while more than one element on the list: insert the sum of the two smallest elements into the proper place on the list by advancing the pointer; delete the two smallest elements. The body of this loop maintains the invariant asserting that the list is non-empty, sorted in non-decreasing order and that the element given by the pointer is not greater than the sum of the two smallest elements on the list. The complexity of a single execution of the body can only be bound by n, but in total the number of times the pointer advances (to which the complexity of the algorithm is proportional) is bounded by the total number of deleted elements, which is 2n-2.
(courtesy of a midterm submission)