type long long is big enough to hold the result.
replace the recursive merge sort implementation by an interative one.