program cutting
implicit none
integer w, h, x, y
integer res
real(4) ss, ww, hh, xx, yy, mm, nn ,ms
read*, w, h, x, y
xx=x
yy=y
ww=w
ww=ww/2
hh=h
hh=h/2
if((xx.eq.ww).and.(yy.eq.hh)) then 
res=1
else if ((xx.ne.ww).or.(yy.ne.hh)) then
res=0
end if
ss=w*h
ss=ss/2
ss=w*h-ss
mm=max((ww*2),(hh*2))
nn=min((ww*2),(hh*2))
mm=mm-1
ms=mm*nn
if(((ss-ms)/ss).lt.(0.01)) then
res=1
ss=ms/2
end if
print*, ss, res
end program