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())
val1 = min(y,H-y) * W
val2 = min(x,W-x) * H
ans = max(val1,val2)
if val1 == val2:
  print(ans,1)
else:
  print(ans,0)

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
elif x==W/2:
    ans=1
elif y==H/2:
    ans=1
else:
    ans=0

print(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(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(int,input().split())
if y*W==x*H:
    ans=1
else:
    ans=0

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if x*y == 0 or (x-W)*(y-H) ==0 or (x == W/2 and y != H/2) or (x != W/2 and y == H/2) :
  print(str(W*H/2) + ' 0')
  exit()
elif y == H / W * x and x != W/2:
  print(str(W*H/2) + ' 0')
  exit()
elif y == H - H / W * x and x != W/2:
  print(str(W*H/2) + ' 0')
  exit()
print(str(W*H/2) + ' 1')

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if x*y == 0 or (x-W)*(y-H) ==0 or (x == W/2 and y != H/2) or (x != W/2 and y == H/2) :
  print(str(W*H/2) + ' 0')
  exit()
elif y == H / W * x and x != W/2:
  print(str(W*H/2) + ' 0')
  exit()
elif y == W - H / W * x and x != W/2:
  print(str(W*H/2) + ' 0')
  exit()
print(str(W*H/2) + ' 1')

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if x*y == 0 or (x-W)*(y-H) ==0 or (x == W/2 and y != H/2) or (x != W/2 and y == H/2) :
  print(str(W*H/2) + ' 0')
  exit()
print(str(W*H/2) + ' 1')

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if x*y == 0 or (x-W)*(y-H) ==0:
  print(str(W*H/2) + ' 0')
  exit()
print(str(W*H/2) + ' 1')

Submission status: Wrong Answer

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

multi_flg = 0
if x == w//2 and y == h//2:
    multi_flg = 1

print(w*h/2,multi_flg)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
while True:
    try:
        W, H, x, y = map(int, input().split())
        
        cut = (x == W // 2) + (y == H // 2)
        if cut > 0:
            area = (W * H) / 2
        else:
            area = min(x*H, y*W)
            
        print(area, 1 if cut > 1 else 0)
    except:
        break

Submission status: Wrong Answer

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

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())
ans=1 if x==w//2 and y==h//2 else 0
print(w*h/2,ans)

Submission status: Wrong Answer

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

a = min(w-x,x)
b = min(h-y,y)
c = a*h
d = b*w
e = max(c,d)

if c == d:
  f = 1
else:
  f = 0

print(e,f)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
print(' '.join((str(W * H / 2.0), '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())
a=[0,0]
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())
S_V = min(y*W, (H-y)*W)
S_A = min(x*H, (W-x)*H)
if y == H:
    S_V = 0
if x == W:
    S_A = 0
if S_V == S_A == 0:
    print("{0:6f}".format(W*H/2), end=' ')
else:
    print("{0:6f}".format(max(S_V,S_A)), end=' ')
if S_V == S_A:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

full_h = min(w - x, x) * h
full_w = min(h - y, y) * w

multi = 0
if full_w > full_h:
    max_area = full_w
elif full_w < full_h:
    max_area = full_h
else:
    max_area = full_h
    multi = 1

print('{0} {1}'.format(max_area, multi))

Submission status: Wrong Answer

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

full_w = min(w - x, x) * w
full_h = min(h - y, y) * h

multi = 0
if full_w > full_h:
    max_area = full_w
elif full_w < full_h:
    max_area = full_h
else:
    max_area = full_h
    multi = 1

print('{0} {1}'.format(max_area, multi))

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 "0", sep=" ")

Submission status: Wrong Answer

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

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

print(max(s1, s2), "1" if s1 == s2 else "0", sep=" ")

Submission status: Wrong Answer

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

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

print(float(max(s1, s2)), "1" if s1 * (10 ** 9) == s2 * (10 ** 9) else "0", sep=" ")

Submission status: Wrong Answer

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

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

print(float(max(s1, s2)), "1" if s1 == s2 else "0", sep=" ")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A=min(W-x,x)*H
B=min(H-y,y)*W

if(A==B):
    print(A,"1")
else:
    print(max(A,B),"0")

Submission status: Wrong Answer

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

A=min(W-x,abs(x-W))*H
B=min(H-y,abs(y-H))*W

if(A==B):
    print(A,"1")
else:
    print(max(A,B),"0")

Submission status: Wrong Answer

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

A=max(W-x,abs(x-W))*H
B=max(H-y,abs(y-H))*W

if(A==B):
    print(A,"1")
else:
    print(max(A,B),"0")

Submission status: Wrong Answer

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

# if W == H:
#     x = 1
# else:
#     x = 0

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

print(W * H // 2, x)

Submission status: Wrong Answer

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

if W == H:
    x = 1
else:
    x = 0

print(W * H // 2, x)

Submission status: Wrong Answer

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

area = max(W, H) * (min(W, H) // 2)
# print(area)

if W == H:
    x = 1
else:
    x = 0

print(area, x)

Submission status: Wrong Answer

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

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

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:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
if (a,b) == (W,H):
    r = 1
else:
    r = 0
print((W*H)/2,int(r))

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
if a == W or b == H:
    r = 0
elif a/W == b/H:
    r = 1
else :
    r = 0
print((W*H)/2,int(r))

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
print((W*H)/2,(1 if a/W == b/H else 0))

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
print((W*H)/2,1)

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
print((W+H)/2,0)

Submission status: Wrong Answer

Solution code:
W,H,a,b =[int(i) for i in input().split()]
print((W+H)/2,1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
print(float(W)*float(H)/2.0, end = " ")
print("{}".format(1 if x == W//2 and y == H//2 else 0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = [float(x) for x in input().split(' ')]
print('{:.10f}'.format(max(min(x*h, (w-x)*h), min(w*y, w*(h-y)))), 1 if (2*x==w and 2*y==h) else 0)

Submission status: Wrong Answer

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

max_area = 0.0
if x > 0:
    area1 = (W - x) * H
    area2 = (x - 0) * H
    if area1 == area2:
        max_area = area1

if y > 0:
    area1 = (H - y) * W
    area2 = (y - 0) * W
    if area1 == area2 and area1 >= max_area:
        max_area = area1
        print('{:.6f} 1'.format(max_area))
        quit()
print('{:.6f} 0'.format(max_area))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
a = 0
b1,b2 = 0,0
if x * h == (w - x) * h:
  a += 1
  b1 = max(x * h,(w - x) * h)
elif w * y == w * (h - y):
  a += 1
  b2 = max(w * y,w * (h - y))

b = max(b1,b2) / 1
if a == 2:
  print(str(b).ljust(15,'0'),1)
else:
  print(str(b).ljust(15,'0'),0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = w * h / 2

num = 0
if w == x * 2 and y == y * 2:
    num = 1
else:
    num = 0

print(str(ans) + " " + str(num))

Submission status: Wrong Answer

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

jud = 0

if x == int(W/2) and y == int(H/2):
    jud = 1

ans = Decimal(H)*Decimal(W)/Decimal(2)
print(ans, jud)

Submission status: Wrong Answer

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

if x == int(W/2) and y == int(H/2):
    jud = 1

W = float(W)
H = float(H)
ans = H*W/2

print(ans, jud)

Submission status: Wrong Answer

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


jud = 0

if x == W//2 and y == H//2:
    jud = 1
if (x == 0 or x == W) and (y == 0 or y == H):
    jud = 1

W = float(W)
H = float(H)
ans = H*W/2

print(ans, jud)

Submission status: Wrong Answer

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

W = float(W)
H = float(H)
ans = H*W/2
jud = 0

if x == W//2 and y == H//2:
    jud = 1

print(ans, jud)

Submission status: Wrong Answer

Solution code:
def solve(string):
    w, h, x, y = map(int, string.split())
    m = w * h * max(min(x, w - x) / w, min(y, h - y) / h)
    f = 1 if w == h and (x == y or x + y == w) else 0
    return str("{} {}".format(m, f))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
def solve(string):
    w, h, x, y = map(int, string.split())
    m = w * h * max(min(x, w - x) / w, min(y, h - y) / h)
    f = 1 if w == h and (x == y and x + y == w) else 0
    return str("{} {}".format(m, f))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
def solve(string):
    w, h, x, y = map(int, string.split())
    m = w * h * max(min(x, w - x) / w, min(y, h - y) / h)
    f = 1 if w == h and x == w / 2 and y == h / 2 else 0
    return str("{} {}".format(m, f))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
def solve(string):
    w, h, x, y = map(int, string.split())
    m = w * h * max(min(x, w - x), min(y, h - y)) / 2
    f = 1 if w == h and x == w / 2 and y == h / 2 else 0
    return str("{} {}".format(m, f))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

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

if x==0 or y==0 or x==w or y==h:
    ans=0
elif w/2==x and h/2==y:
    ans=1
elif w/2==x or h/2==y:
    ans=0
else:
    ans=1


print(w*h/2,ans)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
a = 0
b1,b2 = 0,0
if x * h == (w - x) * h:
  a += 1
  b1 = max(x * h,(w - x) * h)
elif w * y == w * (h - y):
  a += 1
  b2 = max(w * y,w * (h - y))

b = max(b1,b2)
if a == 2:
  print(b,1)
else:
  print(b,0)

Submission status: Wrong Answer

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

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 0)

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2

if x==0 or x==W:
    print(str(W*y) + " 0")
elif y==0 or y==H:
    print(str(H*x) + " 0")

elif W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
    
else:
    a=x*H
    a_sub=W*H-a
    b=W*y
    b_sub=W*H-b
    if min([a,a_sub]) < min([b,b_sub]):
        print(str(min([b, b_sub])) + " 0")
    else:
        print(str(min([a, a_sub])) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2

if x==0 or x==W:
    print(str(W*y) + " 0")
elif y==0 or y==H:
    print(str(H*x) + " 0")

elif W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
    
print("0 0")
# else:
#     a=x*H
#     a_sub=W*H-a
#     b=W*y
#     b_sub=W*H-b
#     if abs(a-a_sub) > abs(b-b_sub):
#         print(str(min([b, b_sub])) + " 0")
#     else:
#         print(str(min([a, a_sub])) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2

if x==0 or x==W:
    print(str(W*y) + " 0")
elif y==0 or y==H:
    print(str(H*x) + " 0")

elif (W_harf == x and H_harf==y) or (W==H and y == x):
    print(str(W_harf*H) + " 1")
    
print("0 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2

if x==0 or x==W:
    print(str(W*y) + " 0")
elif y==0 or y==H:
    print(str(H*x) + " 0")

elif (W_harf == x and H_harf==y) or (W==H and y == x):
    print(str(W_harf*H) + " 1")
    

else:
    a=x*H
    a_sub=W*H-a
    b=W*y
    b_sub=W*H-b
    if abs(a-a_sub) > abs(b-b_sub):
        print(str(min([b, b_sub])) + " 0")
    else:
        print(str(min([a, a_sub])) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2

if x==0 or x==W:
    print(str(W*y) + " 0")
elif y==0 or y==H:
    print(str(H*x) + " 0")

elif W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
    
    
else:
    a=x*H
    a_sub=W*H-a
    b=W*y
    b_sub=W*H-b
    if abs(a-a_sub) > abs(b-b_sub):
        print(str(min([b, b_sub])) + " 0")
    else:
        print(str(min([a, a_sub])) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if x==0:
    print(str(W*y) + " 0")
elif y==0:
    print(str(H*x) + " 0")

elif W == H and x==y:
    print(str(W_harf*H) + " 1")
elif y> x :
    print(str(H*x) + " 0")
elif y < x:
    print(str(W*y) + " 0")
else:
    a=x*H
    b=W*y
    if a < b:
        print(str(b) + " 0")
    else:
        print(str(a) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if W == H and x==y:
    print(str(W_harf*H) + " 1")
elif W_harf == x:
    print(str(H*x) + " 0")
elif H_harf == y:
    print(str(W*y) + " 0")
else:
    a=x*H
    b=W*y
    if a > b:
        print(str(b) + " 0")
    else:
        print(str(a) + " 0")

Submission status: Wrong Answer

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

W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
elif y>x:
    print(str(H*x) + " 0")
elif H_harf == y:
    print(str(W*y) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
#周上の点なら辺に限りなく接する直線を定義すると最小の面積はほぼ0
# if x==0 or W==x or H==y or y==0:
#     print("0 1")
# else:
W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
elif W_harf == x:
    print(str(H*x) + " 0")
elif H_harf == y:
    print(str(W*y) + " 0")
else:
    a=x*H
    b=W*y
    if a > b:
        print(str(b) + " 0")
    else:
        print(str(a) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
#周上の点なら辺に限りなく接する直線を定義すると最小の面積はほぼ0
# if x==0 or W==x or H==y or y==0:
#     print("0 1")
# else:
W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
elif W_harf == x:
    print(str(H*x) + " 0")
elif H_harf == y:
    print(str(W*y) + " 0")
else:
    a=x*H
    b=W*y
    if a > b:
        print(str(b) + " 0")
    elif a < b:
        print(str(a) + " 0")
    else:
        print(str(a) + " 1")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
#周上の点なら辺に限りなく接する直線を定義すると最小の面積はほぼ0
# if x==0 or W==x or H==y or y==0:
#     print("0 1")
# else:
W_harf=W/2
H_harf=H/2
x = abs(W-x)
y = abs(H-y)

if W_harf == x and H_harf==y:
    print(str(W_harf*H) + " 1")
elif W_harf == x:
    print(str(H*x) + " 0")
elif H_harf == y:
    print(str(W*y) + " 0")
else:
    print(str(x*y/2) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
#周上の点なら辺に限りなく接する直線を定義すると最小の面積はほぼ0
if x==0 or W==x or H==y or y==0:
    print("0 1")
else:
    W_harf=W/2
    H_harf=H/2
    x = abs(W-x)
    y = abs(H-y)
    
    if W_harf == x and H_harf==y:
        print(str(W_harf*H) + " 1")
    elif W_harf == x:
        print(str(H*x) + " 0")
    elif H_harf == y:
        print(str(W*y) + " 0")
    else:
        print(str(x*y/2) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = (int(a) for a in input().split())
print(W*H*0.5,end=" ")
if abs(W*0.500-x)==abs(H*0.500-y):
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = (int(a) for a in input().split())
print(W*H*0.5,end=" ")
if abs(W*0.500-x)==abs(H*0.500-y):
    print("1")
elif abs(W*0.500-x)<abs(H*0.500-y):
    print("0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = (int(a) for a in input().split())
if abs(W*0.500-x)==abs(H*0.500-y):
    if x<W-x:
        print(x*H*1.0,end=" ")
    else:
        print((W-x)*H*1.0,end=" ")
    print("1")
elif abs(W*0.500-x)<abs(H*0.500-y):
    if x<W-x:
        print(x*H*1.0,end=" ")
    else:
        print((W-x)*H*1.0,end=" ")
    print("0")
else:
    if y<H-y:
        print(y*W*1.0,end=" ")
    else:
         print((H-y)*W*1.0,end=" ")
    print("0")

Submission status: Wrong Answer

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

s = w * h / 2

if w % 2 == 0 and h % 2 == 0 and x == w // 2 and y == h // 2:
    judge = '1'
elif (w % 2 == 0 and x == w // 2) or (h % 2 == 0 and y == h // 2):
    judge ='0'
else:
    judge = '1'

print(s, judge)

Submission status: Wrong Answer

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

s1 = x * h
s2 = w * h - s1
s3 = w * y
s4 = w *h - s3

s_min1 = min(s1, s2)
s_min2 = min(s3, s4)

if s_min1 == s_min2:
    judge = '1'
else:
    judge = '0'
    
print(max(s_min1, s_min2), judge)

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())
ans = 0
me_x = 0
me_y = 0
total = W * H
# (W - x) * H
if (W - x) > x:
  me_x = x * H
else:
  me_x = (W - x) * H

if (H - y) > y:
  me_y = y * W
else:
  me_y = (H - y) * W

if me_x > me_y:
  me_ans = me_x
else:
  me_ans = me_y

if me_x == (total - me_y):
  ans = 1
elif me_y == (total - me_x):
  ans = 1

if me_x == me_y:
  ans = 1
print(me_ans, ans)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans = 0
me_x = 0
me_y = 0
total = W * H
# (W - x) * H
if (W - x) > x:
  me_x = x * H
else:
  me_x = (W - x) * H

if (H - y) > y:
  me_y = y * W
else:
  me_y = (H - y) * W

if me_x > me_y:
  me_ans = me_x
  if me_x == (total - me_y):
    ans = 1
else:
  me_ans = me_y
  if me_y == (total - me_x):
    ans = 1
if me_x == me_y:
  ans = 1
print(me_ans, ans)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans = 0
# (W - x) * H
if (W - x) > x:
  me_x = x * H
else:
  me_x = (W - x) * H

if (H - y) > y:
  me_y = y * W
else:
  me_y = (H - y) * W

if me_x > me_y:
  me_ans = me_x
else:
  me_ans = me_y
if me_x == me_y:
  ans = 1
print(me_ans, ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(W * H / 2, 1)

Submission status: Wrong Answer

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d1 = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d2 = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1-0) == 0 or int(d2-0) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d1 < d2:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
else:
  if int(d1-d2) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)

Submission status: Wrong Answer

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d = [None for i in range(4)]
d[0] = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d[1] = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)
d[2] = abs(x-w*0.5)
d[3] = abs(y-h*0.5)

print(1,1)
exit()

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d.index().min(d) == 0:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
elif d.index().min(d) == 1:
  if int(d[0]-d[1]) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)
elif d.index().min(d) == 2:
  if y > 0.5*h:
    b = w*y/(w-2*x)
    x1=(x-0.5*w)/y*(b-h)
    if x > 0.5*w:
      print(h*(0.5*w+w-x1)*0.5, 0)
    else:
      print(h*(0.5*w+0.5*w-x1)*0.5, 0)
  else:
    b = h - 0.5*w*y/(x-0.5*w)
    x1=b*y/(0.5*w-x)
    if x > 0.5*w:
      print(0.5*h(0.5*w+w-x1), 0)
    else:
      print(0.5*h(0.5*w+0.5*w-x1), 0)    
elif d.index().min(d) == 3:
  if int(d[2]-d[3]) == 0:
    casenum = 1
  else:
    casenum = 0
  if x > 0.5*w:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(y-0.5*h)/x*w+0.5*h), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(y-0.5*h)/x*w+0.5*h), casenum)
  else:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)

Submission status: Wrong Answer

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d1 = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d2 = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d1 < d2:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
else:
  if int(d1-d2) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)

Submission status: Wrong Answer

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d1 = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d2 = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d1 < d2:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
else:
  if int(d1-d2) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print((w-b)*h*0.5, casenum)

Submission status: Wrong Answer

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d1 = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d2 = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d1 < d2:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
else:
  if int(d1-d2) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > h/w*x:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print((w-b)*h*0.5, casenum)