104. Merge Two Sorted Record Lists
Read two lists of records, each already sorted by score in ascending order.
Input ``` n n lines of: name score m m lines of: name score ```
Print all n + m records merged into one ascending list, one per line as name score.
When a record from each list has the same score, print the one from the first list first.
Merge them in a single pass rather than concatenating and sorting.
Constraints - `1 ≤ n, m ≤ 100000` - Names are 1 to 30 letters with no spaces. - `-1000000 ≤ score ≤ 1000000` - Both lists are already sorted ascending.
Input
The first line contains n, then n lines of name score.
The next line contains m, then m lines of name score.
Both lists are already sorted by score.
Output
Print the merged records, one per line as name score, in ascending score order. On a tie the first list's record comes first.
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.