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



Sample input:
2 3 1 2


Sample output:
3.000000 0

Submission status: Wrong Answer

Solution code:
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)


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


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

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

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = [int(i) for i in input().split()]
flag=0
a=x*2
b=y*2
if W==a & H==b:
    flag=1
W=float(W)
H=float(H)

print(W*H/2,flag)

Submission status: Wrong Answer

Solution code:
W,H,x,y = [int(i) for i in input().split()]
flag=0
a=W*2
b=H*2
if(a==x*2 & b==y*2):
    flag=1

W=float(W)
H=float(H)
print(W*H/2,flag)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
math = 0
num = 0

if x < y:
    math = x * H
elif x > y:
    math = y * W
elif x == y:
    if W < H:
        math = y * W
    else:
        math = x * H
elif x * 2 == W and y * 2 == H:
    math = x * H
    num = 1

print("{} {}".format(float(math), num))

Submission status: Wrong Answer

Solution code:
W, H ,x, y = map(int, input().split())
if W != H and W == x and H == y:
    print(W * H / 2, 1)
elif W == H == x == y:
    print(W * H / 2, 3)
else:
    print(W * H / 2, 0)

Submission status: Wrong Answer

Solution code:
W, H ,x, y = map(int, input().split())
if W == x and H == y:
    print(W * H / 2, 1)
else:
    print(W * H / 2, 0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
math = 0
num = 0

if x < y:
    math = x * H
elif y < x:
    math = y * W
elif x == y:
    math = x * H
    num = 1

print("{} {}".format(float(math), num))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
math = 0
num = 0

if x < y:
    math = x * H
elif y < x:
    math = y * W
elif x * 2 == W and y * 2 == H:
    math = x * H
    num = 1

print("{} {}".format(float(math), num))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
math = 0
num = 0

if x < y:
    math = x * H
elif y < x:
    math = y * W
else:
    math = x * H
    num = 1

print("{} {}".format(float(math), num))

Submission status: Wrong Answer

Solution code:
W,H,x,y = [ int(it) for it in input().split() ]

s = 0

s = max(s, min(H*x,H*(W-x)))
s = max(s, min(W*y,W*(H-y)))
print (s , 1 if min(H*x,H*(W-x)) == min(W*y,W*(H-y)) else 0)

Submission status: Wrong Answer

Solution code:
import math 
W,H,x,y=list(map(int,input().strip().split(' ')))
mid_x,mid_y=W/2,H/2

ans=W*H/2
okay=0
if (x==int(mid_x) and y==int(mid_y)):
    okay=1
print(ans,okay)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def sq(x, y):
    return float(x * y)

if __name__ == '__main__':
    w, h, x, y = list(map(int, input().split()))

    if (x + x == w) and (y + y == h):
        print('{:.6f} {}'.format(sq(w, h)/2, 1))
    else:
        ax = []
        ay = []
        ax.append(sq(x, h))
        ax.append(sq(w-x, h))
        ay.append(sq(w, y))
        ay.append(sq(w, h-y))

        if max(ax) < max(ay):
            print('{:.6f} {}'.format(max(ax), 0))
        else:
            print('{:.6f} {}'.format(max(ay), 0))

Submission status: Wrong Answer

Solution code:
W,H,x,y = [int(i) for i in input().split()]
flag=0
a=int(W/2)
b=int(H/2)
if(a==x & b==y):
    flag=1

W=float(W)
H=float(H)
print(W*H/2,flag)

Submission status: Wrong Answer

Solution code:
W,H,x,y = [int(i) for i in input().split()]
flag=0
a=int(W/2)
b=int(H/2)
if(a==x & b==y):
    flag=1


print(W*H/2,flag)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, input().split())
m1, m2 = float(W)/2, float(H)/2
count = 1
if x == m1 and y == m2:
  count = 2
print(W * H / 2, count)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
m1, m2 = float(W)/2, float(H)/2
count = 1
if x == m1 and y == m2:
  count = 2
print(float(W) * float(H) / 2, count)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
S = W * H / 2
cen_x = None
cen_y = None

x_list = [i for i in range(1, W)]
if len(x_list) % 2 == 1:
    idx = len(x_list) // 2
    cen_x = x_list.pop(idx)
y_list = [i for i in range(1, H)]
if len(y_list) % 2 == 1:
    idy = len(y_list) // 2
    cen_y = y_list.pop(idy)
    
flg = 0
if x == cen_x and y == cen_y:
    flg = True
for i in x_list:
    for j in y_list:
        if i == x and j == y:
            flg = 1

print("{} {}".format(S, flg))

Submission status: Wrong Answer

Solution code:
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w // 2 == x and h // 2 == y else 0
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w % 2 == 0 and h % 2 == 0 else 0
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))

if x*2 == w + y*2 == h:
	#center
	print("{} {}".format(w*h/2, 1))
else:
	print("{} {}".format(w*h/2, 0))

Submission status: Wrong Answer

Solution code:
W,H,x,y = [int(i) for i in input().split()]

S1 = H*x
S2 = (W-x)*H
S3 = W*y
S4 = (H-y)*W

a=[S1,S2]
b=[S3,S4]
aa=min(a)
bb=min(b)
c=[aa,bb]
print(max(c))

if x==W/2 and y==H/2:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))

area = w*h/2
flag = 1
if x == w/2 or y == h/2:
    flag = 0


print(area, flag)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))

area = w*h/2
flag = 0
if x != w/2 or y != h/2:
    flag = 1
elif w == h and x == y:
    flag = 1
print(area, flag)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
print((W*H/2,1) if (x == W/2 and y == H/2) else (W*H/2,0))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
print(W*H/2,1 if (x == W/2 and y == H/2) else W*H/2,0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
ans=w*h//2
if w==x*2 and h==y*2:
        num=1
else:
        num=0
print(ans,num)

Submission status: Wrong Answer

Solution code:
w, h, x, y = [int(elem) for elem in input().split()]

candidate1 = x * h
candidate2 = w * h - candidate1
candidate3 = w * y
candidate4 = w * h - candidate3

flag = 0
if candidate1 >= candidate2:
  min_cand1 = candidate2
else:
  min_cand1 = candidate1

if candidate3 >= candidate4:
  min_cand2 = candidate4
else:
  min_cand2 = candidate3

if min_cand1 == min_cand2:
  flag = 1
  
res = max(min_cand1, min_cand2)
print(res)
print(flag)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
total=W*H
linecut=min(total-(x*H),x*H)
sidecut=min(total-(y*W),y*W)
ans=max(linecut,sidecut)
if linecut==sidecut:
        print(ans,1)
else:
        print(ans,0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
total=W*H
linecut=min(total-(x*H),x*H)
sidecut=min(total-(y*W),y*W)
if linecut==sidecut:
        print(min(linecut,sidecut),1)
else:
        print(min(linecut,sidecut,0))

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = x * H
square_12 = big_square - square_1
if square_1 <= square_12:
  s = square_1
elif square_1> square_12:
  s = square_12

square_2 = W * y
square_22 = big_square - square_2
if square_2 <= square_22:
  t = square_2
elif square_2> square_22:
  t = square_22

if s<=t:
  big = t
elif t<s:
  big = s


  
if W == x *2 and H == y *2:
  way = 1
else:
  way = 0
  

print(big,way)

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = (W - x) * H
square_12 = big_square - square_1
list = [square_1,square_12]
square_2 = W * (H - y)
square_22 = big_square - square_2
list2 = [square_2,square_22 ]
s = min(list)
t = min(list2)
if s<=t:
  big = t
elif t<s:
  big = s


  
if W == x *2 and H == y *2:
  way = 1
else:
  way = 0
  

print(big,way)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())

xslice1 = y*W
xslice2 = (H-y)*W
yslice1 = x*H
yslice2 = (W-x)*H

if abs(xslice1-xslice2) < abs(yslice1-yslice2):
    num = 0
    if xslice1<xslice2:
        print(xslice1,end=" ")
    else:
        print(xslice1, end=" ")
        print(num)
elif abs(xslice1-xslice2) > abs(yslice1-yslice2):
    num = 0
    if yslice1<yslice2:
        print(yslice1,end=" ")
    else:
        print(yslice1, end=" ")
        print(num)
else:
    num = 1
    if yslice1 < yslice2:
        print(yslice1, end=" ")
    else:
        print(yslice1, end=" ")
        print(num)

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = (W - x) * H
square_12 = big_square - square_1
list = [square_1,square_12]
square_2 = W * (H - y)
square_22 = big_square - square_2
list2 = [square_2,square_22 ]
s = min(list)
t = min(list2)
if s<=t:
  big = t
elif t<s:
  big = s


count=0
if square_1 == square_2:
  count += 1
elif square_1 == square_22:
  count += 1
elif square_12 == square_2:
  count += 1
elif square_12 == square_22:
  count += 1
else:
  count=0

if count == 0:
  way = 0
else:
  way = 1

print(big,way)

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = (W - x) * H
square_12 = big_square - square_1
square_2 = W * (H - y)
square_22 = big_square - square_2
list = [square_1,square_12,square_2,square_22 ]
s = min(list)

count=0
if square_1 == square_2:
  count += 1
elif square_1 == square_22:
  count += 1
elif square_12 == square_2:
  count += 1
elif square_12 == square_22:
  count += 1
else:
  count=0

if count == 0:
  way = 0
else:
  way = 1

print(s,way)

Submission status: Wrong Answer

Solution code:
print("anushi")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())

f = 0
if x==W//2 and y==H//2:
    f = 1

print(W*H/2,f)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())

f = 0
if x==W//2 or y==H//2:
    f = 1

print(W*H/2,f)

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

W, H, x, y = [int(i) for i in stdin.readline().rstrip().split()]

if (W == H and (W % 2 == 0 and H % 2 == 0) and x == y and x == W // 2 and y == H // 2):
	ans = H * x
	stdout.write(str(ans) + " 1\n")
else:
	if (x == W // 2 or y == H // 2):
		ans = max((W - x) * H, (H - y) * W)
	else:
		ans = 0
	stdout.write(str(ans) + " 0\n")

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

W, H, x, y = [int(i) for i in stdin.readline().rstrip().split()]

if (W == H and (W % 2 == 0 and H % 2 == 0) and x == y and x == W // 2 and y == H // 2):
	ans = H * x
	stdout.write(str(ans) + " 1\n")
else:
	ans = max((W - x) * H, (H - y) * W)
	stdout.write(str(ans) + " 0\n")

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split());
area = W*H;
multiple = 1 if W == H or x == y else 0;
print("{0:.6f} {1}".format(area / 2, multiple));

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())

xans=h*min(w-x,x)
yans=w*min(h-y,y)
print(max(xans,yans),1 if xans==yans else 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
si=[[1 for i in range(w)]for j in range(h)]
xans=h*min(w-x,x)
yans=w*min(h-y,y)
print(max(xans,yans),1 if xans==yans else 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
xans=h*min(w-x,x)
yans=w*min(h-y,y)
print(min(xans,yans),1 if xans==yans else 0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())

ans=0
for s in [x*H, W*y, (W-x)*H, W*(H-y)]:
    if s<=W*H/2:
        ans=max(ans,s)

flg=1 if W==H else 0

print(float(ans),flg)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())

ans=0
for s in [x*H, W*y, (W-x)*H, W*(H-y)]:
    if s<=W*H/2:
        ans=max(ans,s)

flg=1 if W==H else 0

print(ans,flg)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def sq(x, y):
    return float(x * y)

if __name__ == '__main__':
    w, h, x, y = list(map(int, input().split()))

    if (w // 2 == x) and (h // 2 == y):
        print('{:.6f} {}'.format(sq(w, h)/2, 1))
    else:
        ax = []
        ay = []
        ax.append(sq(x, h))
        ax.append(sq(w-x, h))
        ay.append(sq(w, y))
        ay.append(sq(w, h-y))

        if max(ax) < max(ay):
            print('{:.6f} {}'.format(max(ax), 0))
        else:
            print('{:.6f} {}'.format(max(ay), 0))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def sq(x, y):
    return float(x * y)

if __name__ == '__main__':
    w, h, x, y = list(map(int, input().split()))
    ax = []
    ay = []
    ax.append(sq(x, h))
    ax.append(sq(w-x, h))
    ay.append(sq(w, y))
    ay.append(sq(w, h-y))

    org = 0
    if (w % 2 == 0 and h % 2 == 0) and (w // 2 == x and h // 2 == y):
        org = 1

    if max(ax) < max(ay):
        print('{:.6f} {}'.format(max(ax), org))
    else:
        print('{:.6f} {}'.format(max(ay), org))

Submission status: Wrong Answer

Solution code:
import math
import sys

#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

w, h, x, y = map(int, input().split())
a = min(x*h, (w - x)*h)
b = min(y*w, (h - y)*w)

print (a, 1) if a == b else print(max(a,b), 0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans = max(min(x, W-x)*H, min(y, H-y)*W)
if x==W/2 and y==H/2:
    print(ans, "1")
else:
    print(ans, "0")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

W, H, x, y = map(int, input().split())

m = W * H


print(m / 2, 1 if W // 2 == x and H // 2 == y else 0)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

W, H, x, y = map(int, input().split())

m = W * H

print(m / 2, 0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())

k1=min((W-x)*H,x*H)
k3=min((H-y)*W,y*W)
#k5=min((W-x)*(H-y)*2, W*H-(W-x)*(H-y)*2)
from collections import Counter
kf = max([(k,f) for k, f in dict(Counter([k1,k3])).items()], key=lambda x:x[0])
#print(kf)
if kf[1] > 1:
    print(kf[0], 1)
else:
    print(kf[0], 0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())

k1=min((W-x)*H,x*H)
k3=min((H-y)*W,y*W)
k5=min((W-x)*(H-y)*2, W*H-(W-x)*(H-y)*2)
from collections import Counter
kf = max([(k,f) for k, f in dict(Counter([k1,k3,k5])).items()], key=lambda x:x[0])
#print(kf)
if kf[1] > 1:
    print(kf[0], 1)
else:
    print(kf[0], 0)

Submission status: Wrong Answer

Solution code:
h,w,x,y = map(int,input().split(" "))
t = h * w
a = t - (t * (x / h))
b = t - (t * (y / w))
print(max(a,b),end=" ")
if x / h == y / w:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = list(map(int,input().split(" ")))
size = w*h/2
if x == w//2 and y == h//2:
    pos = 1
else:
    pos = 0
print(str(size) + " " + str(pos))

Submission status: Wrong Answer

Solution code:
w,h,x,y = list(map(int,input().split(" ")))
if w == 0 and h == 0:
    print("0 1")
elif w == 0 or h == 0:
    print("0 0")
else:
    size = w*h/2
    if x == w//2 and y == h//2:
        pos = 1
    else:
        pos = 0
    print(str(size) + " " + str(pos))

Submission status: Wrong Answer

Solution code:
w,h,x,y = list(map(int,input().split(" ")))
if w == 0 or h == 0:
    print("0 1")
else:
    size = w*h/2
    if x == w//2 and y == h//2:
        pos = 1
    else:
        pos = 0
    print(str(size) + " " + str(pos))

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())

s=w*h/2
if w==h:
    z=1
else:
    z=0
print("{:.6f}".format(s),end=" ")
print(z)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())

if(2*x == w & 2*y ==h) :
    ff = 1
else :
    ff = 0

print(str(w * h / 2) + " " + str(ff))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())

hx = h * x
hx2 = h * (w-x)
wy = w * y
wy2 = w * (h-y)

if(hx > hx2) :
    d1 = hx2
else :
    d1 = hx

if(wy > wy2) :
    d2 = wy2
else :
    d2 = wy


if(d1 == d2) :
    ff = 0
else :
    ff = 1

if(d1 > d2) :
    print(str(d1) + " " + str(ff))
else :
    print(str(d2) + " " + str(ff))

Submission status: Wrong Answer

Solution code:
a,b,c,d =map(int,raw_input().split())

if c == a/2 and d == b/2:
    print a*b*.5, 1
else:
    print a*b*.5, 0

Submission status: Wrong Answer

Solution code:
a,b,c,d =map(int,raw_input().split())

if c == a/2 and d == b/2:
    print a*b/2, 1
else:
    print a*b/2, 0

Submission status: Wrong Answer

Solution code:
a,b,c,d =map(int,raw_input().split())

if c == a/2 and d == b/2:
    print(a*b/2.0),
    print(1),
else:
    print(a*b/2.0),
    print(0),

Submission status: Wrong Answer

Solution code:
a,b,c,d =map(int,raw_input().split())

if c == a/2 and d == b/2:
    print(a*b/2),
    print(1)
else:
    print(a*b/2),
    print(0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,raw_input().split())
if x==0 or x==W or y==0 or y==H:
    print("%f %d"%(W*H*0.5, 0))
else:
    print("%f %d"%(W*H*0.5, 1))

Submission status: Wrong Answer

Solution code:
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("POSSIBLE")
    elif q == 0:print("IMPOSSIBLE")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def printrow(a):
    for i in a:
        print(i)
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

#n = ip()                                     #入力整数1つ
n,m,x,y= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(m)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#a.pop(0)は10^5あるときTLEしやすい!注意!抜くなら逆ソート!

print((n*m)/2,end =' ')
if n == 2*x or m == y*2:
    print(1)
else: print(0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
ar1=x*h
ar2=(w-x)*h
ar3=y*(w)
ar4=w*(h-y)
f1=min(ar1,ar2)
f2=min(ar3,ar4)
if(f1==f2):
	print(f1,1)
else:
	print(max(f1,f2),0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split());
area = W*H;
multiple = 1 if W == H else 0;
print("{0:.6f} {1}".format(area / 2, multiple));

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split(" "))

if y == h/w * x or y == (h/w * x * -1) + h or x == w/2 or y == h/2:
    print('{:.6f}'.format(w*h/2),1)
else:
    print('{:.6f}'.format(w*h/2),0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split(" "))

if y == h/w * x or y == (h/w * x * -1) + h:
    print('{:.6f}'.format(w*h/2),1)
else:
    print('{:.6f}'.format(w*h/2),0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split(" "))

if y == h/w * x or y == (h/w * x * -1) + h:
    print('{:.6f}'.format(w*h/2),1)
else:
    print('{:.6f}'.format(w*h/2),0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x == W // 2 and y == H // 2:
    ans = 1
else:
    ans = 0
    
print(W * H / 2, ans)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

S = W * H / 2
multi = 2 * x == W and 2 * y == H

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

multi = 0

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

if X * H == W * Y:
    multi = 1

S = max(X * H, W * Y)

print(S, multi)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

multi = 0

if W == H:
    multi = 1

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, multi)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, multi)
    exit()

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, W * Y)

print(S, multi)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y) / 2
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H / 2
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, W * Y)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, W * Y)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 1

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

S = min(X1 * H, X2 * H, W * Y1, W * Y2)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

S = min(X1 * H, X2 * H, W * Y1, W * Y2)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 1

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = max(X1, X2)
Y = max(Y1, Y2)

S = min(X * H, W * Y)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 1

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, W * Y)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 1

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = max(X1, X2)
Y = max(Y1, Y2)

S = X * Y

print(S, int(multi))

Submission status: Wrong Answer

Solution code:


def main():
    W, H, x, y = map(int, input().split())

    print(H * W /2, x + x == W and y + y == H)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 1)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, Y * W)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if x in [0, W] and y in [0, H]:
    S = 0
    print(0, 0)
    exit()

if (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, Y * W)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:


def main():
    W, H, x, y = map(int, input().split())

    flag = 0    
    #if x/W == y/H :
     #   flag = 1

    print(H * W /2, x + x == W and y + y == H)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if (x in [0, W] and y in [0, H]) or (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 0

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, Y * W)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())

if (x in [0, W] and y in [0, H]) or (x == W / 2 and y == H / 2):
    S = W * H / 2
    print(S, 1)
    exit()

if x in [0, W]:
    S = W * min(y, H - y)
    print(S, 0)
    exit()

if y in [0, H]:
    S = min(x, W - x) * H
    print(S, 0)
    exit()

multi = 1

X1 = x
X2 = (W - x)
Y1 = y
Y2 = (H - y)

X = min(X1, X2)
Y = min(Y1, Y2)

S = max(X * H, Y * W)

print(S, int(multi))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
flag = 0
if (x/w)==(y/h):
  flag = 1
print((w*h)/2,flag)