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

Common Board

HELPPPPPPPPPPPPPPP
Posted by I am david. Tabo. 14 May 2002 14:46
var sol,gam,i,j,k,m,n:longint;
    min,min1:real;

procedure readdata;
  begin
    readln (n,m);
  end;

procedure solve;
  begin
    min:=n;
    if n=1 then
     begin
       writeln (1);
       halt;
     end;
    min1:=m;
    for i:=n to m do
      begin
        k:=i div 2;
        for j:=2 to k do
          if i mod j = 0 then
            gam:=gam+j;
        min:=gam/i;
        if min1>min then
          begin
            sol:=i;
            min1:=min;
          end;
        gam:=1;
      end;
  end;

procedure print;
  begin
    writeln (sol);
  end;

begin
  readdata;
  solve;
  print;
end.