integer::X,Y,L,inst read*,X,Y,L if(X.eq.0.and.Y.ge.0) then inst = 0 else if(Y.ge.0) then inst = 1 else inst = 2 endif print '(i0)',inst+CEILING(ABS(REAL(X)/L))+CEILING(ABS(REAL(Y)/L)) end program