program cut
  implicit none
  integer(8) :: equality
  doubleprecision :: w, h, x, y, s1, s2, ans
  read *, w, h, x, y
  equality = 0
  s1 = minval((/x, w-x/))*h
  s2 = minval((/y, h-y/))*w 
  ans = maxval((/s1, s2/))
  if (s1 == s2) equality = 1 
  print '(i0,a,i0)', ans," ", equality
  stop
end program cut
