input.txt contains 8 test cases. Each test case corresponds to a pair of
lines, for a total of 16 lines. The first line of each pair should be
passed as command line arguments to your program. The second line of the
pair specifies the range. This should be provided via stdin.

The following (untested) code may help you to run your program on the test
cases.

while read args; do 
      read range; 
      echo $range | ./a.out `echo $args`;
done < input.txt