set problem=garden

if not exist check.exe (
	g++ check.cpp -o check.exe
)

if "%1" == "" (
	echo no parametr
	goto END
)

set exec=echo no execution comand

if exist %problem%_%1.dpr (
	dcc32 -cc %problem%_%1.dpr
	set exec=CALL %problem%_%1.exe
)

if exist %problem%_%1.cpp (
	g++ -O2 -Wl,--stack=32000000 %problem%_%1.cpp -o %problem%_%1
	set exec=CALL %problem%_%1.exe
)

if exist %problem%_%1.java (
	javac -cp ".;*" %problem%_%1.java
	set exec=java -Xmx256M -Duser.language=en -Duser.region=US -Duser.variant=US %problem%_%1
)

if exist %problem%_%1.py (
	set exec=%problem%_%1.py
)


del %1.log
for %%i in (tests\??) do (
	copy %%i %problem%.in >nul
	del %problem%.out
	%exec%
	check.exe %problem%.in %problem%.out %%i.a >>%1.log
)

:END