Problem:
Score : 300 points

Problem Statement

There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).
You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

Print the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.

The area printed will be judged correct when its absolute or relative error is at most 10^{-9}.

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

The line x=1 gives the optimal cut, and no other line does.

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1

Solution in Ruby (2.3.3) (judge verdict: Runtime Error)

w, h, x, y = gets.chomp.split(" ").map(&:to_f)
as = []
# x = k
if x < w / 2
  as << h * x
else
  as << h * (w - x)
end
# y = k
if y < h / 2
  as << w * y
else
  as << w * (h - y)
end

# (0,0)
b = 0
a = y / x
if a * w > h
  as << y / a * h / 2
else
  as << a * w * w / 2
end
# (0, h)
b = h
a = (y - b) / x
if -b / a > w
  as << (h - (a * w + b)) * w / 2
else
  as << -b / a * h / 2
end
# (w, 0)
a = y / (x - w)
b = -a * w
if b > h
  as << w - ((h - b) / a) * h / 2
else
  as << w * b / 2
end
# (w, h)
a = (y - h) /  (x - w)
b = y / (a * x)
if b < 0
  as << w - (-b / a) * h / 2
else
  as << (h - b) * w / 2
end
a_max = as.max
puts a_max
if as.count {|v| v == a_max} > 1
  puts 1
else
  puts 0
end