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:
w, h, x, y = map(int, input().split())

case = 0

if int(w / 2) == x and int(h / 2) == y:
  case = 1
else:
  case = 0
  
s = w*h/2

print(s,case)

Submission status: Wrong Answer

Solution code:
from sys import stdin

w,h,x,y = [int(x) for x in stdin.readline().rstrip().split()]

if x == w/2 and y == h/2:
    print(w*h/2,1)
elif x >= w/2 and y <= h/2:
    print(max((w-x)*h,y*w),0)
elif x <= w/2 and y >= h/2:
    print(max((h-y)*w,x*h),0)
else:
    print(max((w-x)*h,(h-y)*w),0)

Submission status: Wrong Answer

Solution code:
from sys import stdin

w,h,x,y = [int(x) for x in stdin.readline().rstrip().split()]

if x == w/2 and y == h/2:
    print(w*h/2,1)
else:
    if h*x >= w*y and h*x <= w*h/2:
        if h*x == w*h/2:
            print(h*x,1)
        elif h*x == w*y:
            print(h*x,1)
        else:
            print(h*x,0)
    elif h*x >= w*y and h*x > w*h/2:
        if h*x == w*y:
            print(max(w*h-h*x,w*y),1)
        else:
            print(max(w*h-h*x,w*y),0)
    elif h*x <= w*y and w*y <= w*h/2:
        if w*y == w*h/2:
            print(w*y,1)
        elif h*x == w*y:
            print(w*y,1)
        else:
            print(w*y,0)
    else:
        if h*x == w*y:
            print(max(w*h-y*w,h*x),1)
        else:
            print(max(w*h-y*w,h*x),0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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


if w//2 == x and h//2 == 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())
A=min(x*h,(w-x)*h)
B=min(y*w,(h-y)*w)
print(max(A,B),'01'[A==B])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
half_s = W*H*0.5
tmp = abs(1-abs(x-y))
print(half_s,tmp)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, input().split())
half_s = W*H*2
tmp = (x-y)**2**0.5
print(half_s,tmp-1)

Submission status: Wrong Answer

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

A=W*H/2

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

print(str(A)+' '+str(m))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(W * H / 2, end=' ')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
if x==y==0 or x==w or y==h:
    xec,yec=w*h/2,w*h/2
else:
    xec=min((w-x)*h,x*h)
    yec=min(w*(h-y),w*y)
print('{} {}'.format(max(xec,yec),1 if xec == yec else 0))

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
xec=min((w-x)*h,x*h)
yec=min(w*(h-y),w*y)
print('{} {}'.format(max(xec,yec),1 if xec == yec else 0))

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
if x>w/2:
    xec=(w-x)*h
else:
    xec=x*h
if y>h/2:
    yec=w*(h-y)
else:
    yec=w*y
if xec == yec:
    judge=1
else:
    judge=0
print('{} {}'.format(max(xec,yec),judge))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
res = 0
i = abs(x / W - 0.5)
j = abs(y / H - 0.5)
if i == j:
    res = min(x, W-x) * H
    flag = 1
elif i > j:
    res = W * min(y, H-y)
    flag = 0
else:
    res = min(x, W-x) * H
    flag = 0

print(res, flag)

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
'''
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
# 直線上に存在すれば三角形の面積
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")
# 直線上にない時、長方形の面積
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
    if horizon == vertical:
        print("1")
    else:
        print("0")
'''

print("{:.6f}".format(W * H /2) , end = ' ')
if W // 2 == x and H // 2 == y:
    print('1')
else:
    print("0")

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
flag = False
# 直線上に存在すれば三角形の面積
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")
# 直線上にない時
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
    #if horizon == vertical:
    if x == W//2 and y == H //2:
        print("1")
    else:
        print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
flag = False
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")
    exit()
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')

if horizon == vertical:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
flag = False
if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    flag = True
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')

if horizon == vertical and not flag:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
tri_flag = False
if x == W and y == H:
    print("{:.6f}".format(W * H / 2) , end = ' ')
    tri_flag = True
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')

if horizon == vertical and not tri_flag:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
if x == W and y == H:
    print("{:.6f}".format(W * H / 2) , end = ' ')
else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
if horizon == vertical and horizon != 0:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
if horizon == vertical and horizon != 0:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

Solution code:
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
print(max(horizon , vertical) , end = ' ')
if horizon == vertical:
    print("1")
else:
    print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s1 = min(W - x, x) * H
s2 = W * min(H - y, y)

if s1==s2:
    print(s1,end=" ")
    print(1)
elif s1<s2:
    print(s2,end=" ")
    print(0)
else:
    print(s1,end=" ")
    print(0)

Submission status: Wrong Answer

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

if x==y==0 or (x==W and y==H) or (x==0 and y==H) or (x==W and y==0):
    print("0 0")

elif W%2==0 and W//2==x and H%2==0 and H//2==y:
    print((W/2)*H,end=" ")
    print(1)
elif W%2==0 and W//2==x:
    print((W/2)*H,end=" ")
    print(0)
elif H%2==0 and H//2==y:
    print((H/2)*W,end=" ")
    print(0)
else:
    s1=min(W-x,x)*H
    s2=W*min(H-y,y)
    if s1==s2:
        print(s1,end=" ")
        print(1)
    elif s1<s2:
        print(s2,end=" ")
        print(0)
    elif s1>s2:
        print(s1,end=" ")
        print(0)

Submission status: Wrong Answer

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

if W%2==0 and W//2==x and H%2==0 and H//2==y:
    print((W/2)*H,end=" ")
    print(1)
elif W%2==0 and W//2==x:
    print((W/2)*H,end=" ")
    print(0)
elif H%2==0 and H//2==y:
    print((H/2)*W,end=" ")
    print(0)
else:
    s1=min(W-x,x)*H
    s2=W*min(H-y,y)
    if s1==s2:
        print(s1,end=" ")
        print(1)
    elif s1<s2:
        print(s2,end=" ")
        print(0)
    elif s1>s2:
        print(s1,end=" ")
        print(0)

Submission status: Wrong Answer

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

print((w * h) / 2, 1 if(x == w // 2 and y == h // 2) else 0)

Submission status: Wrong Answer

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

print((w * h) / 2, 2 if(x == w // 2 and y == h // 2) else 1)

Submission status: Wrong Answer

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

if 2 * x == w and 2 * y == h:
	print(x * y / 2, '1')
else:
	print(x * y / 2, '0')

Submission status: Wrong Answer

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

center_x = w / 2
center_y = h / 2

if x == center_x and y == center_y:
	print(x * y / 2, '1')
else:
	print(x * y / 2, '0')

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
A = min(x * H,(W - x) * H)
B = min(y * W,(H - y) * W)
if x == W and y == H:
  print(W * H / 2,0)
  exit()
elif x == 0 and y == 0:
  print(W * H / 2,0)
  exit()
elif x == W and y == 0:
  print(W * H / 2,0)
  exit()
elif x == 0 and y == H:
  print(W * H / 2,0)
  exit()
elif x == 0 and y > 0 and y < H:
  print(min(y * W,(H - y) * W))
  if H - y == y:
    print(0)
  else:
    print(1)
    exit()
elif y == 0 and x > 0 and x < H:
  print(min(x * H,(W - x) * H))
  if W - x == x:
    print(0)
  else:
    print(1)
    exit()
print(max(A,B),end=" ")
if A == B:
  print(1)
elif A > B and x % 2 == 0:
  print(0)
elif A <= B and y % 2 == 0:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
A = min(x * H,(W - x) * H)
B = min(y * W,(H - y) * W)
if x == W and y == H:
  print(W * H / 2,0)
  exit()
elif x == 0 and y == 0:
  print(W * H / 2,0)
  exit()
elif x == W and y == 0:
  print(W * H / 2,0)
  exit()
elif x == 0 and y == H:
  print(W * H / 2,0)
  exit()

print(max(A,B),end=" ")
if A == B:
  print(1)
elif A > B and x % 2 == 0:
  print(0)
elif A <= B and y % 2 == 0:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
A = min(x * H,(W - x) * H)
B = min(y * W,(H - y) * W)
if x == W and y == H:
  print(W * H / 2,0)
  exit()
print(max(A,B),end=" ")
if A == B:
  print(1)
elif A > B and x % 2 == 0:
  print(0)
elif A <= B and y % 2 == 0:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
A = min(x * H,(W - x) * H)
B = min(y * W,(H - y) * W)
print(max(A,B),end=" ")
if A == B:
  print(1)
elif A > B and x % 2 == 0:
  print(0)
elif A <= B and y % 2 == 0:
  print(0)
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(W*H/2.0, end=" ")

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
if H > W:
    if x < (W/2):
        ans = H * x
    else:
        ans = H * (W - x)
else:
    if y < (H/2):
        ans = W * y
    else:
        ans = W * (H - y)
a1 = H * x
a2 = H * (W-x)
a3 = W * y
a4 = W * (H -y)
if a1 == a2 or a1 == a3 or a1 == a4 or a2 == a3 or a2 == a4 or a3 == a4:
    count = 1
else:
    count = 0
ans = float(ans)
A=[]
A.append(ans)
A.append(count)
for i in range(2):
    print(A[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int, input().split()))
area=[]
diaA = (W * H) - (y * x / W) / 2
diaB = (W * H) - (x * y / H) / 2
diaC = (y * x / W) / 2
diaD = (x * y / H) / 2
area.extend([x * H, (W - x) * H, W * y, W * (H - y), diaA, diaB, diaC, diaD])
area.sort()
print(area[4])
if area.count(area[4]) >= 2 and area[4] == W * H / 2:
    print(1)
elif area.count(area[4]) >= 2 and area[4] != W * H /2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int, input().split()))
area=[]
diaA = (W * H) - (y * x / W) / 2
diaB = (W * H) - (x * y / H) / 2
diaC = (y * x / W) / 2
diaD = (x * y / H) / 2
area.extend([x * H, (W - x) * H, W * y, W * (H - y), diaA, diaB, diaC, diaD])
area.sort()
print(area[4])
if area.count(area[4]) >= 2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int, input().split()))
area=[]
diaA = (W * H) - (y * x / W) / 2
diaB = (W * H) - (x * y / H) / 2
diaC = (y * x / W) / 2
diaD = (x * y / H) / 2
area.extend([x * H, (W - x) * H, W * y, W * (H - y), diaA, diaB, diaC, diaD])
area.sort()
print(area[4])
if area[4] == W * H / 2 and area.count(area[4]) >= 3:
    print(1)
elif area[4] != W * H / 2 and area.count(area[4]) >= 2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int, input().split()))
area=[]
diaA = (W * H) - (y * x / W)
diaB = (W * H) - (x * y / H)
diaC = (y * x / W)
diaD = (x * y / H)
area.extend([x * H, (W - x) * H, W * y, W * (H - y), diaA, diaB, diaC, diaD])
area.sort()
print(area[4])
if area[4] == W * H / 2 and area.count(area[4]) >= 3:
    print(1)
elif area[4] != W * H / 2 and area.count(area[4]) >= 2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

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

print(W * H / 2, end=" ")
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if W == x*2 and H == y*2:
    ans = x*H
    print('%f %i'%(ans,1))
    sys.exit()

horizontal_ratio =  float(x)/W
vertical_ratio = float(y)/H

if abs(horizontal_ratio-0.50) > abs(vertical_ratio-0.50):
    ans = W * min(y,H-y)#
else:
    ans = H * min(x,W-x)#
print('%f %i'%(ans,0))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
judge = 1 if w == h else 0
if w >= h:
    ans = w * y
else:
    ans = h * x
print(ans, judge)

Submission status: Wrong Answer

Solution code:

#N = int(input())
A = input().split()
#B = input().split()
for i in range(4):
    A[i] = int(A[i])
#for i in range(N):
#    B[i] = int(B[i])

ue = A[0]*(A[1]-A[2])
shita = A[0]*A[2]
migi = A[1]*(A[0]-A[3])
hidari = A[1]*A[3]
chinpo = True

if ue > shita:
    if migi > hidari:
        if migi == ue:
            print(str(ue) + " " + "1")
        else:
            print(str(ue) + " " + "0")
    else:
        if migi == hidari:
            print(str(migi) + " " + "1")
            chinpo = False 
        if hidari == ue & chinpo:
            print(str(ue) + " " + "1")
        else:
            print(str(ue) + " " + "0")
else:
    if ue == shita:
        print(str(ue) + " " + "1")
        chinpo = False
    if migi > hidari & chinpo:
        if migi == ue:
            print(str(ue) + " " + "1")
        else:
            print(str(ue) + " " + "0")
    else:
        if migi == hidari:
            print(str(migi) + " " + "1")
            chinpo = False
        if hidari == ue & chinpo:
            print(str(ue) + " " + "1")
        else:
            print(str(ue) + " " + "0")

Submission status: Wrong Answer

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

print (w * h  / 2 ,end=" ")
print (0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

r1 = x * y
r2 = (w - x) * y
r3 = x * (h - y)
r4 = (w - x) * (h - y)

r12 = r1 + r2
r34 = r3 + r4
r13 = r1 + r3
r24 = r2 + r4

mulans = 0
ans = 0

if r12 - r13 < 10 ** (-9):
    mulans = 1

ans = w*h/2

print(str(ans) + ' ' + str(mulans))

Submission status: Wrong Answer

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

r1 = x * y
r2 = (w - x) * y
r3 = x * (h - y)
r4 = (w - x) * (h - y)

r12 = r1 + r2
r34 = r3 + r4
r13 = r1 + r3
r24 = r2 + r4

mulans = 0
ans = 0

if r12 - r13 < 10 ** (-9):
    mulans = 1

ans = max(min(r12, r34), min(r13, r24))

print(str(ans) + ' ' + str(mulans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

sx = min(x*H, (W-x)*H)
sy = min(y*W, (H-y)*W)
print(max(sx, sy),end = ' ')
if sx < sy:
    if sy == W*H - sx:
        print(1)
    else:
        print(0)
elif sy < sx:
    if sx == W*H - sy:
        print(1)
    else:
        print(0)
else:
    print(1)

Submission status: Wrong Answer

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

sx = min(x*H, (W-x)*H)
sy = min(y*W, (H-y)*W)
print(max(sx, sy),end = ' ')
print(1 if sx == sy or sx + sy == W*H else 0)

Submission status: Wrong Answer

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

sx = min(x*H, (W-x)*H)
sy = min(y*W, (H-y)*W)
print(max(sx, sy),end = ' ')
print(1 if sx == sy else 0)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf8 -*-

w,h,x,y = map(int, input().split())
rec = w * h
o = '0'
all = sorted([rec * (y / h), rec * (h - y)/ h, rec * (x / w), rec * (w - x)/ w], reverse = True)
for i, n in enumerate(all):
    if n <= rec / 2:
        tr = n
        if tr != 0:
            if tr == rec / 2:
                if all[i + 2] == tr:
                    o = '1'
            elif all[i + 1] == tr:
                o = '1'
        break
ans = str(tr) + ' ' + o
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf8 -*-
import fractions

w,h,x,y = map(int, input().split())
rec = w * h
o = '0'
if x == w:
    if y == h:
        tr = 0
    else:
        tr = min(rec * (y / h), rec * (h - y)/ h)
else:
    if y == h:
        tr = min(rec * (x / w), rec * (w - x)/ w)
    else:
        all = sorted([rec * (y / h), rec * (h - y)/ h, rec * (x / w), rec * (w - x)/ w], reverse = True)
        for i, n in enumerate(all):
            if n <= rec / 2:
                tr = n
                if tr == rec / 2:
                    if all[i + 2] == tr:
                        o = '1'
                elif all[i + 1] == tr:
                    o = '1'
                break
ans = str(tr) + ' ' + o
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def test():
    w,h,x,y = map(int,input().split())
    if x == w//2 and y == h//2:
        print("{:.7f}".format(w*h*(1/2)),"1")
    else:
        print("{:.7f}".format(max((h/2)*w,(w/2)*2)),"0")


if __name__ == "__main__":
    test()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(int,input().split())
ans=0

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

print(H*W/2,ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(int,input().split())
ans=0

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

print(int(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(float,input().split())
if y==0 or y==H:
    if x==(W/2):
        ans=1
    else:
        ans=0
elif x==0 or x==W:
    if y==(H/2):
        ans=1
    else:
        ans=0
elif y*W==x*H or y*W==-x*H:
    ans=1
else:
    ans=0

print(float(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(float,input().split())
if y*W==x*H or y*W==-x*H:
    ans=1
else:
    ans=0

print(int(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(float,input().split())
if y==0 or y==H:
    if x==(W/2):
        ans=1
    else:
        ans=0
elif x==0 or x==W:
    if y==(H/2):
        ans=1
    else:
        ans=0
elif y*W==x*H:
    ans=1
else:
    ans=0

print(int(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(float,input().split())
if y==0 or y==H:
    ans=0
elif x==0 or x==W:
    ans=0
elif y*W==x*H:
    ans=1
else:
    ans=0

print(int(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
W,H,x,y=map(float,input().split())
if y*W==x*H:
    ans=1
else:
    ans=0

print(int(max(min(x,W-x)*H,min(y,H-y)*W)),ans)

Submission status: Wrong Answer

Solution code:
W,H,x,y = (int(i) for i in input().split())
if x == W or x == 0:
    xarea = W * H
else:
    xarea = min(x * H,(W - x) * H)

if y == H or y == 0:
    yarea = H * W
else:
    yarea = min(y * W , (H - y) * W)

if xarea == yarea:
    print(str(xarea) + " " + str(1))

elif xarea > yarea:
    print(str(xarea) + " " + str(0))
else:
    print(str(yarea) + " " + str(0))

Submission status: Wrong Answer

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

if x <= W/2:
    xarea = x * H
else:
    xarea = (W - x) * H

if y <= H/2:
    yarea = y * W
else:
    yarea = (H - y) * W


if xarea == yarea:
    print(str(xarea) + " " + str(1))

elif xarea > yarea:
    print(str(xarea) + " " + str(0))
else:
    print(str(yarea) + " " + str(0))

Submission status: Wrong Answer

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

if x <= W/2:
    xarea = x * H
else:
    xarea = (W - x) * H

if y <= H/2:
    yarea = y * H
else:
    yarea = (H - y) * W


if xarea == yarea:
    print(str(xarea) + " " + str(1))

elif xarea > yarea:
    print(str(xarea) + " " + str(0))
else:
    print(str(yarea) + " " + str(0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


h, w, x, y = LI()
if w/2 == x and h/2 == y:
    print(h*w/2, 1)
else:
    print(h*w/2, 0)

Submission status: Wrong Answer

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

yoko=[x*h,(w-1)*h]
tate=[w*y,w*(h-1)]
if min(yoko)==min(tate):
  print(min(yoko),1)
elif min(yoko)>min(tate):
  print(min(yoko),0)
else:
  print(min(tate),0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    area1 = area2 = 0.0
    div = 0

    if (x == 0 and y == 0) or (x == W and y == H):
        area1 = area2 = W * H / 2
    elif W == H and x == y:
        area1 = area2 = W * H / 2
        if x*2 == W and y*2 == H:
            div =1
    elif x == 0:
        area1 = W * y
        area2 = W * (H - y)
    elif y == 0:
        area1 = x * H
        area2 = (W - x) * H
    else:
        area1 = x * H
        area2 = y * W
        if area1 == area2:
            div = 1

    print(min(area1, area2), div, sep=' ')


    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    area1 = area2 = 0.0
    div = 0

    if (x == 0 and y == 0) or (x == W and y == H):
        area1 = area2 = W * H / 2
    elif x == 0:
        area1 = W * y
        area2 = W * (H - y)
    elif y == 0:
        area1 = x * H
        area2 = (W - x) * H
    else:
        area1 = x * H
        area2 = y * W
        if area1 == area2:
            div = 1

    print(min(area1, area2), div, sep=' ')


    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    w, h, x, y = list(map(int, input().split()))
    flag = 0
    if min(x, w-x) * h == min(y, h-y) * w:
        flag = 1

    print(max(min(x, w-x) * h, min(y, h-y) * w), flag)
resolve()

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if x==W//2 and y==H//2:
  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())
if x==W//2 and y==H//2:
  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())
if x == W //2 and  y == H //2:
  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())
val1 = min(y,H-y) * W
val2 = min(x,W-x) * H
ans = max(val1,val2)
if ans == (W *H /2) or val1 == val2:
  print(ans,1)
else:
  print(ans,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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