Submission #3510762


Source Code Expand

var
  x,y,i,j,n:longint;
function max(a,b:longint):longint;
begin
  if a>b then exit(a);
  exit(b);
end;
function zs(x:longint):boolean;
var
  i:longint;
begin
  if x=2 then exit(false);
  for i:=2 to trunc(sqrt(x)) do
    if x mod i=0 then exit(false);
  exit(true);
end;
begin
  readln(n);
  while n<>0 do
  begin
    k:=0;
    for i:=1 to n div 2+1 do
    begin
      if n mod i=0 then
      begin
        if zs(n div i) then k:=max(n div i,k);
        if zs(i) then k:=max(i,k);
        writeln(k);
        break;
      end;
    end;
    readln(n);
  end;
end.

Submission Info

Submission Time
Task B - Working for the World
User luogu_bot5
Language Pascal (FPC 2.6.2)
Score 0
Code Size 564 Byte
Status CE