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 1224. Spiral

Where is wrong?
Posted by ural_Linyue 12 Nov 2002 10:12
read(n,m);
  if (n=1) or (m=1) then
  begin
    writeln('0');
    halt;
  end;
  if (n=2) then
  begin
    writeln('2');
    halt;
  end;
  if (m=2) then
  begin
    writeln('3');
    halt;
  end;
  if (n>m) then
    write(n+m-2:0:0)
  else write(2*n-2:0:0);
end.