Q: How do I prepare an input with 2K integers? Of course it is
impossible to type this from keyboard manually.
A: You can write a small C++ program which prints out 2K random
integers:
#include <iostream>
using std::cout;
using std::endl;
int main()
{
const int K = 100000;
srand( time(NULL) );
for (int i=0; i<2*K; i++)
cout << rand() << endl;
return 0;
}
Running the executable binary file will output 2K random integers to the
screen. If you want to save them in a file, you may type the command
"a.out > input.1", which saves the output in a file. Then in your next
step you may type the command "merge.exe < input.1" to read the input
from this file.