/VOXO - Vòng xoắn

<Problem>

http://ntucoder.net/Problem/Details/35
              Uses Crt;
        Var    x,y,r,x1,y1,i,j,num:longint;
        Procedure Neptune;
        begin
            x:=x+1; y:=(-(x-1)); r:=r+2;
            for i:=y to (y+(r-2)) do
             begin
                 inc(num);
                 if (x1=x) and (y1=i) then exit;
             end;
            for i:=x-1 downto (x-r+1) do
             begin
                 inc(num);
                 if (x1=i) and (y1=y+(r-2)) then exit;
             end;
            for i:=y+(r-2)-1 downto -x do
             begin
                 inc(num);
                 if (x1=x-r+1) and (y1=i) then exit;
             end;
            for i:=(x-r+1+1) to x do
             begin
                  inc(num);
                  if (x1=i) and (y1=y-1) then exit;
             end;
             Neptune;
        end;
        Begin
            readln(x1,y1);
            num:=1; r:=1;  y:=0; x:=0;
            if (x1=0) and (y1=0) then begin writeln(num); exit; end;
            Neptune;
            writeln(num);
            readln;
        End.