выдается ошибка exited with exitcode = 2

Выдается ошибка.
Program c:\olympiads\a.exe exited with exitcode = 2
Вот исходный код:
Program c:\olympiads\a.exe exited with exitcode = 2
Вот исходный код:
- Код: Выделить всё
Program A;
var
dovoid : boolean;
i, i1, maxprint : integer;
f1 : text;
T, N : integer;
D, Ai, Bi, Ci, max : Real;
Begin
assign(f1,'a.in');
reset(f1);
ReadLn(f1, T);
i := 1;
while (i<(T+1)) do
Begin
i := i + 1;
ReadLn(f1, N, D);
i1 := 0;
max := 0;
while (i1<N) do
Begin
i1 := i1 + 1;
ReadLn(f1, Ai, Bi, Ci);
if (((Ai<=D) or (Bi<=D)) or (Ci<=D)) Then
Begin
dovoid := true;
end;
if ((Ai*Ai)+(Bi*Bi)-((Ai*Ai)+(Bi*Bi))/(Ci*Ci))<(D*D) Then
Begin
dovoid :=true;
end;
if ((Ci*Ci)+(Bi*Bi)-((Ci*Ci)+(Bi*Bi))/(Ai*Ai))<(D*D) Then
Begin
dovoid :=true;
end;
if ((Ai*Ai)+(Ci*Ci)-((Ai*Ai)+(Ci*Ci))/(Bi*Bi))<(D*D) Then
Begin
dovoid :=true;
end;
if (dovoid and (max<(Ai*Bi*Ci))) Then
Begin
max := Ai*Bi*Ci;
maxprint := i1;
end;
end;
WriteLn(maxprint);
end;
end.