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 Python (3.4.3) (judge verdict: Wrong Answer)

class Dot():
    def __init__(self,x: int,y: int):
        self.__dot = [x,y]
    def getX(self) -> int:
        return self.__dot[0]
    def getY(self) -> int:
        return self.__dot[1]
    def __sub__(self,dot2):
        return self.__class__(self.getX() - dot2.getX(),dot2.getY() - dot2.getY())
    def __repr__(self):
        return "( " + str(self.getX()) + " , " + str(self.getY()) + " )"

class Direction():
    vertical = "vertical "
    horizontal = "horizontal"
    def __init__(self,dire: str):
        __direction = str()
        self.direction = dire
    def getDirection(self) -> str:
        return self.__direction

class Line():
    __startPosiIndex = 0
    __endPosiIndex = 1
    def __init__(self,start: Dot,end: Dot):
        self.__coordinate = []
        self.__coordinate.append(start)
        self.__coordinate.append(end)
    def getStartPosi(self) -> Dot:
        return self.__coordinate[self.__startPosiIndex]
    def getEndPosi(self) -> Dot:
        return self.__coordinate[self.__endPosiIndex]
    def getDirection(self) -> Direction:
        if (self.getEndPosi() - self.getStartPosi()).getX() == 0:
            return Direction.vertical
        elif (self.getEndPosi() - self.getStartPosi()).getY() == 0:
            return Direction.horizontal
    @staticmethod
    def generateLine(assingPoint: Dot,direction: str,length: int):
        if direction == Direction.vertical:
            #print(Direction.vertical)
            return Line(Dot(assingPoint.getX(),0),Dot(assingPoint.getX(),length))
        elif direction == Direction.horizontal:
            #print(Direction.horizontal)
            return Line(Dot(0,assingPoint.getY()),Dot(length,assingPoint.getY()))
    def __repr__(self):
        return "[" + self.getStartPosi().__repr__() + " -> " + self.getEndPosi().__repr__() + "]"

class Rectangular():
    def __init__(self,start: Dot,end: Dot):
        self.__coordinate = []
        self.__coordinate.append(start)
        self.__coordinate.append(end)
    def getStartPosi(self) -> Dot:
        return self.__coordinate[0]
    def getEndPosi(self) -> Dot:
        return self.__coordinate[1]
    def split(self,line: Line):
        if line.getDirection() == Direction.horizontal:
            return Rectangular(self.getStartPosi(),line.getEndPosi()),Rectangular(line.getStartPosi(),self.getEndPosi())
        elif line.getDirection() == Direction.vertical:
           return Rectangular(self.getStartPosi(),line.getEndPosi()),Rectangular(line.getStartPosi(),self.getEndPosi()) 
    def getArea(self) -> int:
        width = abs(self.getEndPosi().getX() - self.getStartPosi().getX())
        hight = abs(self.getEndPosi().getY() - self.getStartPosi().getY())
        #print("width:" + str(width) + " * hight:" + str(hight) + " = " + str(width*hight))
        return width*hight
    def __repr__(self):
        return "[" + self.getStartPosi().__repr__() + " -> " + self.getEndPosi().__repr__() + "]"

indata = list(map(int,input().split()))
width = indata[0]
hight = indata[1]
X = indata[2]
Y = indata[3]

assingPoint = Dot(X,Y)
rec1 = Rectangular(Dot(0,0),Dot(width,hight))
rec1.getArea()
vertLine = Line.generateLine(assingPoint,Direction.vertical,hight)
horiLine = Line.generateLine(assingPoint,Direction.horizontal,width)

ways = 0

subrec1, subrec2 = rec1.split(vertLine)

if subrec1.getArea() == subrec2.getArea():
    ways = 1

areas1 = min([subrec1.getArea(),subrec2.getArea()])

if areas1 == 0:
    areasq = max([subrec1.getArea(),subrec2.getArea()])

subrec3,subrec4 = rec1.split(horiLine)
areas2 = min([subrec3.getArea(),subrec4.getArea()])

if subrec3.getArea() == subrec4.getArea():
    ways = 1

if areas2 == 0:
    areas2 = max([subrec3.getArea(),subrec4.getArea()])

if areas1 == areas2:
    ways = 1
minMaxArea = max([areas1,areas2])

print(minMaxArea,end=" ")
print(ways)