@echo off
set prob=trolleys
set model=md_certify

echo Compiling input files generator...

call javac doall.java

echo Generating input files...

call java -cp . doall
del *.class

echo Compiling model solution...

copy ..\%prob%_%model%.java %prob%_%model%.java > nul
call javac %prob%_%model%.java

for %%i in (??) do (
  echo Generating %%i.a...
  copy %%i %prob%.in > nul
  call java -cp . %prob%_%model%
  copy %prob%.out %%i.a > nul
  copy %prob%.aux %%i.b > nul
)
del %prob%.in
del %prob%.out
del %prob%.aux
del %prob%_%model%.*
if exist %prob%_%model%$*.* del %prob%_%model%$*.*

echo Done.