|  | 
|  | 
| back to board | what is WA 6 my solition is here Posted by zzzlll  11 Jan 2007 12:21vars,n,m,y:extended;
 begin
 readln(n,m);
 if m<n then begin
 if m=1 then writeln('1')
 else begin
 s:=3;
 y:=0;
 if m<>2 then
 repeat
 y:=y+1;
 m:=m-1;
 until m<=2;
 writeln(s+(y*2):0:0);
 end;
 end
 else if (n=m) or (m>n) then begin
 if n=2 then writeln('2')
 else if n=1 then writeln('1')
 else begin
 s:=1;
 repeat
 s:=s+1;
 n:=n-1;
 until n<=2;
 writeln(2*s:0:0);
 end;
 end;
 end.
 | 
 | 
|