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 1023. Buttons

whi i get cm
Posted by I am david. Tabo. 15 Apr 2002 17:47
var ga,i,n:longint;
    b:boolean;
begin
  read (n);
  while i=n do
  begin
    if n mod i = 0 then
    begin
  ga:=i
b:=true;
break;
end;
inc (i);
end;
if (ga=2)and (not(b))then
  writeln (n div 2 - 1)
else
  writeln (ga-1);
end.