You appear to be trying to pass run time arguments to your program at compile time - as far as I know, that doesn't work. The only non-option arguments accepted by
gcc are the names of files to be compiled.
It's hard to give precise instructions because you haven't shared the source code of your program (or explained how it handles arguments) but probably what you want is something like:
gcc findtopk.c -o findtopk
to compile and link your program; then
./findtopk 500 5 test1.txt test2.txt test3.txt test4.txt test5.txt outfile.txt
to run it with argument list
test1.txt test2.txt test3.txt test4.txt test5.txt outfile.txt.
The details of argument parsing in C are off-topic here but there are plenty of online resources, for example