your prog seems ok to me, you are still getting puzzled with multiple input problems i think, because you are not handling it correctly still

. anyway, multiple input problem starts with with a number to denote how many blocks of input are present, then the blocks of input are given with a seperating blank line, seperating them. so, for this problem the input may be like this:
so modifying your code a little would get accepted:
[pascal]
{ blah blah variable declaration here }
var
mulinput,kounter:integer;
dummystr:string;
{ ... more variables and procedures }
{ main procedure here }
begin
readln(mulinput);
readln(dummystr); { track the blank line }
for kounter:=1 to mulinput do
begin
{ repeat }
if eof(input) then break;
n:=0;
{ ... more code goes here }
{ until false; }
end;
end.[/pascal]this prog should produce P.E, and if you handle the output correctly according to the mulinput procedures, you'll overcome P.E.
ps. i am not familiar with pascal, so sorry if anything is wrong!