@echo off

if NOT exist testgen.exe goto :EOF
testgen.exe 1000 12345 1 5000 > 4.in
testgen.exe 100000 11245 10000000 1000000000 > 5.in
if NOT exist testgen6.exe goto :EOF
testgen6.exe 50000 123 > 6.in
if NOT exist testgen8.exe goto :EOF
testgen8.exe 87000 3824 > 8.in
if NOT exist testgen9.exe goto :EOF
testgen9.exe 100000 17 > 9.in

if NOT exist sol.exe goto :EOF                      
for /l %%i in (4,1,9) do (
  copy %%i.in nearnum.in > NUL 2>&1
  sol.exe
  copy nearnum.out %%i.out > NUL 2>&1
)

del nearnum.in
del nearnum.out
