ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1204. Idempotents

I am getting output limit exceeded. Can you help me? here is my program
Posted by Giorgi Dalakishvili (Tbilisi SU) 15 Dec 2005 19:42
I am getting output limit exceeded. Can you help me? here is my program:
var
a,b,c,d,i,k,j:integer;
p:boolean;
s:array[1..1000] of integer;
begin
readln(i);
for a:=1 to i do
readln(s[a]);
for k:=1 to i do begin
if k<>1 then writeln(' ');
write(0,' ',1);
p:=false;
if s[k] mod 2=0 then begin
a:=2; b:=trunc(s[k]/2); p:=true; end;
d:=3;
while p=false do
if (s[i] mod d)=0 then begin a:=d; b:=trunc(s[k]/d); p:=true; end
else d:=d+2;
c:=a;
while c+1<s[i] do begin
if (c-1) mod b=0 then write(' ',c);
if (c+1) mod b=0 then write(' ',c+1);
c:=c+a;
end; end;
end.