merge part by part

O(n * log k)