What did you learn? Heaps track "frontiers" efficiently. The heap contains one candidate from each source.
The heap size is bounded by , not . Bounded size gives you instead of .
Store enough metadata in heap entries to know where the next element comes from. This pattern applies to merging any sorted streams: files, arrays, iterators.