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

r_x = x / w
r_y = y / h
if abs(0.5-r_x) == abs(0.5-r_y):
    print(str(w*h/2) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
if r_x==0.5 and r_y==0.5:
    print(str(w*h/2) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a // 2 == c and b // 2 == d:
    print(str(a * b / 2) + " " + str(1))
else:
    print(str(a * b / 2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a // 2 == c and b // 2 == d:
    print(str(a * b / 2) + " " + str(1))
else:
    print(str(min((a - c) * b, a * (b - d), c * b, a * d)) + " " + str(0))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a // 2 == c and b // 2 == d:
    print(str(a * b / 2) + " " + str(1))
else:
    print(str(min((a - c) * b, a * (b - d))) + " " + str(0))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a // 2 == c and b // 2 == d:
    print(str(a * b / 2) + " " + str(1))
else:
    print(str(max((a - c) * b, a * (b - d))) + " " + str(0))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a // 2 == c and b // 2 == d:
    print(str(a * b / 2) + " " + str(0))
else:
    print(str(max((a - c) * b, a * (b - d))) + " " + str(1))

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:
# coding: utf-8
# Your code here!

W, H, x, y = map(float, input().split())
     
if (x * W == y * H) or (H * W == x * H + y * W) or (x == W / 2) or (y == H / 2):
    Rect1 = H * W / 2
    Rect2 = H * W / 2
else:
    if (W - x) <= W / 2:
        Rect1 = H * (W - x)
    else:
        Rect1 = H * x
    if (H - y) <= H / 2:
        Rect2 = W * (H - y)
    else:
        Rect2 = W * y
if Rect1 >= Rect2 and (x != W / 2 or y != H / 2):
    print(Rect1, 0)
elif Rect1 <= Rect2 and (x != W / 2 or y != H / 2):
    print(Rect2, 0)
else:
    print(Rect1, 1)

Submission status: Wrong Answer

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

W, H, x, y = map(float, input().split())
     
if (x * W == y * H) or (x * H == y * W) or (x == W / 2) or (y == H / 2):
    Rect1 = H * W / 2
    Rect2 = H * W / 2
else:
    if (W - x) <= W / 2:
        Rect1 = H * (W - x)
    else:
        Rect1 = H * x
    if (H - y) <= H / 2:
        Rect2 = W * (H - y)
    else:
        Rect2 = W * y
if Rect1 >= Rect2 and (x != W / 2 or y != H / 2):
    print(Rect1, 0)
elif Rect1 <= Rect2 and (x != W / 2 or y != H / 2):
    print(Rect2, 0)
else:
    print(Rect1, 1)

Submission status: Wrong Answer

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

W, H, x, y = map(float, input().split())
     
if (x * W == y * H) or (x * H == y * W) or (x == W / 2) or (y == H / 2):
    print(W * H / 2, 1)
else:
    if (W - x) <= W / 2:
        Rect1 = H * (W - x)
    else:
        Rect1 = H * x
    if (H - y) <= H / 2:
        Rect2 = W * (H - y)
    else:
        Rect2 = W * y
 
    if Rect1 > Rect2:
        print(Rect1, 0)
    elif Rect1 < Rect2:
        print(Rect2, 0)
    else:
        print(Rect1, 1)

Submission status: Wrong Answer

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

W, H, x, y = map(float, input().split())
     
if (x * W == y * H) or (x * H == y * W):
    print(W * H / 2, 1)
else:
    if (W - x) <= W / 2:
        Rect1 = H * (W - x)
    else:
        Rect1 = H * x
    if (H - y) <= H / 2:
        Rect2 = W * (H - y)
    else:
        Rect2 = W * y
 
    if Rect1 == 0 and Rect2 == 0:
        print(W * H, 1)
    elif Rect1 > Rect2:
        print(Rect1, 0)
    elif Rect1 < Rect2:
        print(Rect2, 0)
    else:
        print(Rect1, 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
W,H,x,y = map(float, input().split())
div_virtical = [(H-y)*W,y*W]
div_horizontal = [(W-x)*H,x*H]
vmin = np.amin(div_virtical)
hmin = np.amin(div_horizontal)
print("{0} {1}".format(vmin if vmin>hmin else hmin, 1 if vmin==hmin else 0) )

Submission status: Wrong Answer

Solution code:
import numpy as np
W,H,x,y = map(int, input().split())
x_right = W-x
y_above = H-y
div_virtical = [(H-y)*W,y*W]
div_horizontal = [(W-x)*H,x*H]
vmin = np.amin(div_virtical)
hmin = np.amin(div_horizontal)
print("{0} {1}".format(vmin if vmin>hmin else hmin, 1 if vmin==hmin else 0) )

Submission status: Wrong Answer

Solution code:
import numpy as np
W,H,x,y = map(int, input().split())
x_right = W-x
y_above = H-y
div_virtical = [(H-y)*W,y*W]
div_horizontal = [(W-x)*H,x*H]
vmin = np.amin(div_virtical)
hmin = np.amin(div_horizontal)
print("{0} {1}".format(vmin if vmin<hmin else hmin, 1 if vmin==hmin else 0) )

Submission status: Wrong Answer

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

# x
rx=x*h
if rx > (w-x)*h:
    rx=(w-x)*h

# y
ry=w*y
if ry > w*(h-y):
    ry=w*(h-y)

if rx == ry:
    print(max(rx, ry), '1')
else:
    print(max(rx, ry), '0')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

flag = 0
if w // 2 == x and h // 2 == y:
  flag = 1
  
print(str(w * h / 2) + " " + str(flag))

Submission status: Wrong Answer

Solution code:
# 2つの入力を空白で分割し、数値化
W, H, x, y = map(float, input().split())

s1_1 = x * H
s1_2 = (W-x) * H

s2_1 = W * y
s2_2 = W * (H-y)


s1_min = min(s1_1, s1_2)
s2_min = min(s2_1, s2_2)

s_max = max(s1_min, s2_min)

has_same = 1 if (s1_min == s2_min) else 0

print(s_max, has_same)

Submission status: Wrong Answer

Solution code:
W, H, x, y = list(map(int, input().split()))
if x == 0 or x == W or y == 0 or y == H:
    print(float(W * H), end=" ")
    if ((x == 0 or x == W) and (y == 0 or y == H)):
        print(1)
    else:
        print(0)
elif W % 2 == 0 and x == W // 2:
    if H % 2 == 0 and y == H // 2:
        print(float(W * y), end=" ")
    else:
        print(float(W * y), end=" ")
    print(1)
elif H % 2 == 0 and y == H // 2:
    print(float(x * H), end=" ")
    print(1)
else:
    if W > H:
        W, H = [H, W]
        x, y = [y, x]
    x = x if x < W - x else W - x
    y = y if y < H - y else H - y
    print((x + y) ** 2 / 2, end=" ")
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

# たてに切るやつ
rect1 = (w-x)*h if 2*x > w else x*h
# よこに切るやつ
rect2 = (h-y)*w if 2*y > h else y*w
judge = 1 if rect1 == rect2 else 0

print(max(rect1, rect2), judge)

Submission status: Wrong Answer

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

# たてに切るやつ
rect1 = (w-x)*h if 2*x > w else x*h
# よこに切るやつ
rect2 = (h-y)*w if 2*y > h else y*w

judge = 1 if rect1 == rect2 else 0
print(max(rect1, rect2), judge)

Submission status: Wrong Answer

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

menseki_1 = min(W*y, W*(H-y))
menseki_2 = min(H*x, H*(W-x))

if menseki_1 > menseki_2:
    if (H ==2*y):
        print(menseki_1, 1)
    else:
        print(menseki_1, 0)
else:
    if (W == 2*x):
        print(menseki_2, 1)
    else:
        print(menseki_2, 0)

Submission status: Wrong Answer

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

menseki_1 = max(W*y, W*(H-y))
menseki_2 = max(H*x, H*(W-x))

if menseki_1 > menseki_2:
    if (H ==2*y):
        print(menseki_1, 1)
    else:
        print(menseki_1, 0)
else:
    if (W == 2*x):
        print(menseki_2, 1)
    else:
        print(menseki_2, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
ans = [0,0]
ans[0] = w*h // 2
if w/2-x + h/2-y == 0 :
      ans[1] = 1
for i in ans :
      print(i,end=" ")

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
ans = [0,0]
ans[0] = w*h // 2
ans[1] = max(1,abs(w//2-x + h//2-y))
for i in ans :
      print(i,end=" ")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
s = w * h / 2
print(s, 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(float, input().split(' '))
square = w * h
div_x = square - ((w - x) * h)
div_y = square - (w * (h - y))
if div_x == div_y:
    print("{:9f}".format(div_x), 1)
elif div_x > div_y:
    print("{:9f}".format(div_x), 0)
elif div_x < div_y:
    print("{:9f}".format(div_y), 0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, input().split(' '))
square = w * h
div_x = square - ((w - x) * h)
div_y = square - (w * (h - y))
if div_x == div_y:
    print("{:9f}".format(div_x), 1)
elif div_x < div_y:
    print("{:9f}".format(div_x), 0)
elif div_x > div_y:
    print("{:9f}".format(div_y), 0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, input().split(' '))
div_x = (w - x) * h
div_y = w * (h - y)
if div_x == div_y:
    print("{:9f}".format(div_x), 1)
elif div_x > div_y:
    print("{:9f}".format(div_x), 0)
elif div_x < div_y:
    print("{:9f}".format(div_y), 0)

Submission status: Wrong Answer

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

S = float(W*H/2.0)
d = 0
if x == y and W == H:
        d = 1
print(str(S) + " " + str(d))

Submission status: Wrong Answer

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

S = W*H/2
d = 0
if x == y and W == H:
        d = 1
print(str(S) + " " + str(d))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if a / 2 == c and b / 2 == d:
    print(str(a * b / 2) + " " + "1")
else:
    print(a * b / 2)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans1 = W * H / 2
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 = max(min(x, W-x)*H, min(y, H-y)*W)
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())

if int(w / 2) == x and int(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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=(int(x) for x in input().split())
S=x*y/2
c=1 if (x*2==W or y*2==H) else 0
print(str(S)+' '+str(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

a = input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])


# (x,y)を中心とは対照(W/2,H/2)
if float(x) == W/2 and float(y) == H/2:
    print("{0} {1}".format((W*H)/2,1))
else:
    x2 = W - x
    y2 = H - y

    if x == x2:
        print("{0} {1}".format(float(min(x*H,(W-x)*H)),0))
    else:
        S = ((y-(y-y2)*x/(x-x2))+y+(y-y2*(W-x)/(x-x2)))*H/2
        print("{0} {1}".format(min(S,W*H-S),0))

Submission status: Wrong Answer

Solution code:
import numpy as np

a = input().split(" ")
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])


# (x,y)を中心とは対照(W/2,H/2)
if float(x) == W/2 and float(y) == H/2:
    print("{0} {1}".format((W*H)/2,1))
else:
    x2 = W - x
    y2 = H - y

    if x == x2:
        print("{0} {1}".format(float(max(x*H,(W-x)*H)),0))
    else:
        S = ((y-(y-y2)*x/(x-x2))+y+(y-y2*(W-x)/(x-x2)))*H/2
        print("{0} {1}".format(max(S,W*H-S),0))

Submission status: Wrong Answer

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


def solv(w, h, x, y):
    ha = w * h / 2
    dw = abs(w/2-x)
    dh = abs(h/2-y)
    if dw == 0 and dh == 0:
        return (ha, 1)
    elif dw == 0 or dh == 0:
        return (ha, 0)
    else:
        return (ha, 1)


if __name__ == '__main__':

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

    ans = solv(w, h, x, y)

    print(ans[0], ans[1])

Submission status: Wrong Answer

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


def solv(w, h, x, y):
    ha = w * h / 2
    dw = abs(w-x)
    dy = abs(x-y)
    if dw == 0 or dy == 0:
        return (ha, 0)
    else:
        return (ha, 1)


if __name__ == '__main__':

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

    ans = solv(w, h, x, y)

    print(ans[0], ans[1])

Submission status: Wrong Answer

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

wm = x if x <= w/2 else w-x 
hm = y if y <= h/2 else h-y 

if wm ==0:
    print(w * hm / 2, 0)
    sys.exit()

if hm ==0:
    print(wm * h / 2, 0)
    sys.exit()

s1, s2 = wm * h, w * hm

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

Submission status: Wrong Answer

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

wm = x if x <= w/2 else w-x 
hm = y if y <= h/2 else h-y 

s1, s2 = wm * h, w * hm

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split()
W = int(a[0])
H = int(a[1])
x = int(a[2])
y = int(a[3])
if x == W/2 or y == H/2 and (x != W/2 or y != H/2):
  print(H+W/2,0)
else:
  print(H+W/2,1)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
H_2 = H/2.000000000
W_2 = W/2.000000000
V=0.000000000
others=0
#座標（x,y)が中心を通るとき、どんな直線を引いても面積は一定である。
#面積はW*H/4によって求まる
V = W*H/2.000000000
if(H_2 == x and W_2 == y):
   
    others=1
#小数点6桁まで表示
print("{0:.6f}".format(V),others)
#そのほかの場合は引き方が一意に決まる

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
H_2 = H/2.0
W_2 = W/2.0
V=0.0
others=0
#座標（x,y)が中心を通るとき、どんな直線を引いても面積は一定である。
#面積はW*H/4によって求まる
V = W*H/2.0
if(H_2 == x and W_2 == y):
   
    others=1
#小数点6桁まで表示
print("{0:.6f}".format(V),others)
#そのほかの場合は引き方が一意に決まる

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
H_2 = H/2.0
W_2 = W/2.0
V=0.0
others=0
#座標（x,y)が中心を通るとき、どんな直線を引いても面積は一定である。
#面積はW*H/4によって求まる
V = W*H/4.0
if(H_2 == x and W_2 == y):
   
    others=1
#小数点6桁まで表示
print("{0:.6f}".format(V),others)
#そのほかの場合は引き方が一意に決まる

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
H_2 = H/2.0
W_2 = W/2.0
V=0.0
others=0
#座標（x,y)が中心を通るとき、どんな直線を引いても面積は一定である。
#面積はW*H/4によって求まる
V = W*H/4.0
if(H_2 == x and W_2 == y):
   
  others=1
#小数点9桁まで表示
print("{0:.9f}".format(V),others)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
a = w * h / 2.0
if w & 1 == 1 and h & 1 == 1 and x == w // 2 + 1 and y == h // 2 + 1:
  b = 1
else:
  b = 0
print("%.6f %d" % (a, b))

Submission status: Wrong Answer

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

def main():
    s = list(map(int,input().split()))

    if (s[0] // 2.0 == s[2]) and (s[1] // 2.0 == s[3]):
        print(s[0] * s[1] // 2.0, 1)
    else:
        print(s[0] * s[1] // 2.0, 0)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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())
ans1 = H * W / 2.0
ans2 = 1 if int(W/2)==x and int(H/2)==y else 0                                                                                                     
print('{:.6f} {}'.format(ans1,ans2))

Submission status: Wrong Answer

Solution code:
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 = map(int, input().split())
ans = 0
num = w*h/2
if x==(w//2) and y == (h//2):
    ans = 1
print("{} {}".format(num, ans))

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(whxy) for whxy in input().split()]
S = W*H //2
if x==W//2 and y==H//2:
  print(str(S) + " 1")
else:
  print(str(S) + " 0")

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
w = i[0]
h = i[1]
x = i[2]
y = i[3]

m = (w*h)/2

if x + x == w and y + y == h:
  s = 1
else:
  s = 0
  

print(m,end='');print(s)

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
w = i[0]
h = i[1]
x = i[2]
y = i[3]

m = (w*h)/2

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

print(m,end='');print(s)

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
w = i[0]
h = i[1]
x = i[2]
y = i[3]

m = (w*h)/2

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

print(m,end='');print(s)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

area = W * H
half_area = area / 2

if x == y:
    method_number = 1
elif area == 0:
    method_number = 0
else:
    method_number = 0

print("{} {}".format(half_area, method_number))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

area = W * H
half_area = area / 2

if x == y:
    method_number = 1
elif area == 0:
    method_number = 1
else:
    method_number = 0

print("{} {}".format(half_area, method_number))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

area = W * H
half_area = area / 2

if x == y:
    method_number = 1
else:
    method_number = 0

print("{} {}".format(half_area, method_number))

Submission status: Wrong Answer

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

if x == 0 and y == 0:
    print(w * h, 0)
    exit()
    
if y == 0:
    print(min((w - x) * h, x * h), 0)
    exit()
if x == 0:
    print(min((h - y) * w, y * w), 0)
    exit()

div_xl = x * h
div_xr = (w - x) * h
smaller_x = min(div_xl, div_xr)
div_yu = (h - y) * w
div_yd = y * w
smaller_y = min(div_yu, div_yd)

f = 0
if smaller_x == smaller_y:
    f = 1

print(max(smaller_x, smaller_y), f)

Submission status: Wrong Answer

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

if y == 0:
    print(min((w - x) * h, x * h), 0)
    exit()
if x == 0:
    print(min((h - y) * w, y * w), 0)
    exit()

div_xl = x * h
div_xr = (w - x) * h
smaller_x = min(div_xl, div_xr)
div_yu = (h - y) * w
div_yd = y * w
smaller_y = min(div_yu, div_yd)

f = 0
if smaller_x == smaller_y:
    f = 1

print(max(smaller_x, smaller_y), f)

Submission status: Wrong Answer

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

div_xl = x * h
div_xr = (w - x) * h
smaller_x = min(div_xl, div_xr)
div_yu = (h - y) * w
div_yd = y * w
smaller_y = min(div_yu, div_yd)

f = 0
if smaller_x == smaller_y:
    f = 1

print(max(smaller_x, smaller_y), f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)
sq = W*H/2
print("{} 1".format(sq))

Submission status: Wrong Answer

Solution code:
W,H,x,y = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)
sq = W*H/2
print("{} 0".format(sq))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 1".format(sq1))
  else:
    print("{} 1".format(sq1))
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 1".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 0".format(sq1))
  else:
    print("{} 0".format(sq1))
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
  
if sq1 == sq2:
  print("{} 1".format(sq1))
  
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 0".format(sq1))
  else:
    print("{} 0".format(sq1))
    
else:
  if sq2 == W*H/2:
    print("{} 0".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
  
if sq1 == sq2:
  print("{} 1".format(sq1))
  
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 0".format(sq1))
  else:
    print("{} 0".format(sq1))
    
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
  
if sq1 == sq2:
  print("{} ,1".format(sq1))
  
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 1".format(sq1))
  else:
    print("{} 0".format(sq1))
    
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
  
if sq1 == sq2:
  print("{} 1".format(sq1))
  
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 1".format(sq1))
  else:
    print("{} 0".format(sq1))
    
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
  
if sq1 == sq2:
  print("{} 1".format(sq1))
  
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} 1".format(sq1))
  else:
    print("{} 0".format(sq1))
    
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} ,1".format(sq1))
elif sq1 > sq2:
  if sq1 == W*H/2:
    print("{} ,1".format(sq1))
  else:
    print("{} ,0".format(sq1))
else:
  if sq2 == W*H/2:
    print("{} 1".format(sq2))
  else:
    print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} ,1".format(sq1))
elif sq1 > sq2:
  print("{} ,0".format(sq1))
else:
  print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} ,1".format(sq1))
elif sq1 > sq2:
  print("{} 0".format(sq1))
else:
  print("{} ,0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} ,1".format(sq1))
elif sq1 > sq2:
  print("{} 0".format(sq1))
else:
  print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{}  1".format(sq1))
elif sq1 > sq2:
  print("{} 0".format(sq1))
else:
  print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  print("{} 0".format(sq1))
else:
  print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 < sq2:
#  print("{} 0".format(sq1))
#else:
  print("{} 0".format(sq2))

Submission status: Wrong Answer

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  print("{} 0".format(sq1))
#else:
 # print("{} 0".format(sq2))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (x != 0 and y/x == H/W):
  print(S, 1)
else:
  print(S, 0)

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)