Google interview question

Merge n sorted arrays using an integer stream as the output.