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

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

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

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

multi = 1

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

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

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

print(S, int(multi))

Submission status: Wrong Answer

Solution code:


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

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

    print(H * W /2, flag)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

multi = 0

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

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

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

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

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

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

print(S, int(multi))

Submission status: Wrong Answer

Solution code:


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

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

        
    
        
    result = H * W /2


    print(result,flag)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

multi = 0

if x == 0 or y == 0:
    multi = 0
    S = 0
elif x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

print(S, int(multi))

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H or x == 0 or y == 0:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

print(S, int(multi))

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    multi = x != 0 and x != W and y != 0 and y != H

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

print(S, int(multi))

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    multi = x != 0 and x != W and y != 0 and y != H

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

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    multi = not (x == 0 or x == W or y == 0 or y == H)

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

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    multi = x == 0 or x == W or y == 0 or y == H

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

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    S = max(X1 * Y1, X1 * Y2, X2 * Y1, X2 * Y2)
    multi = 0

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    multi = X1 == X2 or Y1 == Y2
    S = max(X * H, Y * W)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

    multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

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

    multi = 0 #int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    S = min(X * H, Y * W)
    multi = 0 #int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    S = min(X * H, Y * W)
    multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

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

    S = X * Y
    multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

    S = min(X1 * Y1, X1 * Y2, X2 * Y1, X2 * Y2)
    # multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x
    X2 = (W - x)
    Y1 = y
    Y2 = (H - y)

    S = min(X1 * Y1, X1 * Y2, X2 * Y1, X2 * Y2)
    multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x / W
    X2 = x / (W - x)
    Y1 = y / H
    Y2 = y / (H - y)

    S = min(X1 * Y1, X1 * Y2, X2 * Y1, X2 * Y2)
    multi = int(x == 0 or x == W or y == 0 or y == H)

print(S, multi)

Submission status: Wrong Answer

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

multi = 0

if x / W == y / H:
    multi = 1
    S = W * H / 2
else:
    X1 = x / W
    X2 = x / (W - x)
    Y1 = y / H
    Y2 = y / (H - y)

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

    S = X * Y

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = W * H / 2
elif x / W <= y / H:
    multi = (x * H) == (W * y)
    S = min(x * H, W * y)
elif x / W >= y / H:
    multi = (x * H) == (W * y)
    S = min(x * H, W * y)

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = W * H / 2
elif x / W <= y / H:
    S = min(x * H, W * y)
elif x / W >= y / H:
    S = min(x * H, W * y)

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = min(x * H, W * y)
elif x / W <= y / H:
    S = min(x * H, W * y)
elif x / W >= y / H:
    S = min(x * H, W * y)

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = x * H
elif x / W <= y / H:
    S = min(x * H, W * y)
elif x / W >= y / H:
    S = min(x * H, W * y)

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = x * H
else:
    S = max(x * H, W * y)

print(S, multi)

Submission status: Wrong Answer

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

# print(W, H, x, y)

multi = 0

# print(x / W, y / H)

if x / W == y / H:
    multi = 1
    S = x * H
elif x / W <= y / H:
    S = x * H
elif x / W >= y / H:
    S = W * y

print(S, multi)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

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

print(Decimal(w) * Decimal(h) / 2, int((w//2==x) and (h//2==y)))

Submission status: Wrong Answer

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

print(float(w) * float(h) / 2, int((w//2==x) and (h//2==y)))

Submission status: Wrong Answer

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

a1 = x * H
a2 = (W - x) * H
b1 = W * y
b2 = W * (H -y)

a = min([a1,a2])
b = min([b1,b2])

ans1 = max([a,b])
ans2 = 0
if a == b:
    ans2 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

print(w * h / 2, int((w//2==x) and (h//2==y)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
xl = W // 2 == x
yl = H // 2 == y
w = W - x
h = H - y
if xl and yl:
    ans = [W * H / 2, 1]
elif xl:
    if W * h >= w * H:
        ans = [W * h, 1]
    else:
        ans = [w * H, 0]
elif yl:
    if w * H >= W * h:
        ans = [w * H, 1]
    else:
        ans = [W * h, 0]
else:
    ans = [max(W * h, w * H), 0]
print(*ans)

Submission status: Wrong Answer

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

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

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

    org = 0
    if max(ax) == max(ay):
        org = 1

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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


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

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

Submission status: Wrong Answer

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

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

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

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


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

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
A1=x*H
A2=(W-x)*H
A3=W*y
A4=(H-y)*W
if A1==A2==A3==A4:
    print(format(A1,'.6f'),"1")
elif (A1==A2):
    if (A3!=A4):
        print(format(A1,'.6f'),"0")
    elif(A3==A4 and A1>A3):
        print(format(A1,'.6f'),"0")
elif(A3==A4):
    if(A1!=A2):
        print(format(A3,'.6f'),"0")
    elif(A1==A2 and A3>A1):
        print(format(A3,'.6f'),"0")

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
A1=x*H
A2=(W-x)*H
A3=W*y
A4=(H-y)*W
if A1==A2==A3==A4:
    print(format(A1,'.6f'),"1")
elif (A1==A2):
    if (A3!=A4):
        print(format(A1,'.6f'),"0")
elif(A3==A4):
    if(A1!=A2):
        print(format(A3,'.6f'),"0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(x) for x in input().split(' ')]
s = W * H / 2
i = 2*x == W and 2*y == H
print(s, i)

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(x) for x in input().split(' ')]
s = float(x) * float(y) / 2
i = 2*x == W and 2*y == H
print(s, i)

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(x) for x in input().split(' ')]
s = x * y / 2
i = 2*x == W and 2*y == H
print(s, i)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, input().split())
if x == W/2 or 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())

area = W * H / 2

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

Submission status: Wrong Answer

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

area = W * H / 2

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

Submission status: Wrong Answer

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

area = W * H / 2

if (x, y) == (W//2 + W%2, H//2 + H%2) or (x, y) == (W, H):
    print(str(area) + ' 1')
else:
    print(str(area) + ' 0')

Submission status: Wrong Answer

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

area = W * H / 2

if (x, y) == (W//2 + W%2, H//2 + H%2):
    print(str(area) + ' 1')
else:
    print(str(area) + ' 0')

Submission status: Wrong Answer

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

area = W * H / 2

if (x, y) == (int(W/2), int(H/2)):
    print(str(area) + ' 1')
else:
    print(str(area) + ' 0')

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
#最大の面積を求める
ans = (w * h) /2
#xとy共に偶数の場合1を出力するようにする、それ以外は0を出力させる
if x % 2 == 0 and y % 2 == 0:
  num = 1
else:
  num = 0
print(ans,num)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
area = w*h
straight = h/w
judge = 1 if y == x*straight else 0
print("{:.6f} {}".format(area/2, judge))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
#最大の面積を求める
ans = (w * h) /2
#wとh共に偶数の場合1を出力するようにする、それ以外は0を出力させる
if w % 2 == 0 and h % 2 == 0:
  num = 1
else:
  num = 0
print(ans,num)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
#最大の面積を求める
ans = (w * h) /2
#wとh共に偶数の場合1を出力するようにする、それ以外は0を出力させる
if w % 2 == 0 and h % 2 == 0:
  print(ans,1)
else:
  print(ans,0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
a = 0
if 2*x == W and 2*y == H:
     a = 1
print(str(W*H//2)+" "+str(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = H * (W - x)
b = H * W - H * (W - x)
c = W * (H - y)
d = H * W - W * (H - y)

if W == H:
    if y == x or y == -x + H:
        e = 1
    else:
        e = 0
else:
    if x == W * (1 / 2) and y == H * (1 / 2):
        e = 1
    else:
        e = 0


if a <= b:
    if c <= d:
        if a <= c:
            print(c, e)
        else:
            print(a, e)
    else:
        if a <= d:
            print(d, e)
        else:
            print(a, e)
else:
    if c <= d:
        if b <= c:
            print(c, e)
        else:
            print(b, e)
    else:
        if b <= d:
            print(d, e)
        else:
            print(b, e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = H * (W - x)
b = H * W - H * (W - x)
c = W * (H - y)
d = H * W - W * (H - y)

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

if a <= b:
    if c <= d:
        if a <= c:
            print(c, e)
        else:
            print(a, e)
    else:
        if a <= d:
            print(d, e)
        else:
            print(a, e)
else:
    if c <= d:
        if b <= c:
            print(c, e)
        else:
            print(b, e)
    else:
        if b <= d:
            print(d, e)
        else:
            print(b, e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

top = W * y
bottom = W * (H - y)
m1 = min(top, bottom)

left = H * x
right = H * (W - x)
m2 = min(left, right)

print('{} {}'.format(max(m1, m2), 1 if m1 == m2 else 0))

Submission status: Wrong Answer

Solution code:
def resolve():
	w,h,x,y=map(int,input().split())
	cho=0
	if (w//2,h//2)==(x,y):
		cho=1
	print('{:.9f} {}'.format(w*h/2,cho))
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
	w,h,x,y=map(int,input().split())
	cho=0
	if (w//2,h//2)==(x,y):
		cho=1
	print('{:.6f} {}'.format(w*h/2,cho))
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(str(int(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())

ans=str(w*h/2)

if x==w//2 and y==h//2:
    print(ans+" "+"1")
else:
    print(ans+" "+"0")

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

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

counter = 0
maximum = 0
a1 = list()
a2 = list()
a3 = list()

a1.append((w - x) * h)
a1.append(x * h)

a2.append((h - y) * w)
a2.append(y * w)

a3.append((h * w)//2)
a3.append((h * w)//2)

if (a1[0] == a1[1]):
	maximum = a1[0]
	counter += 1

if (a2[0] == a2[1]):
	maximum = max(maximum, a2[0])
	counter += 1
	
if (a3[0] == a3[1]):
    maximum = max(maximum, a3[0])
    counter += 1

if (counter == 3):
	stdout.write(str(maximum) + " 1\n")
else:
	stdout.write(str(maximum) + " 0\n")

Submission status: Wrong Answer

Solution code:
#C問題
W,H,x,y = map(int,input().split())
s1 = min(x,W-x)*H
s2 = min(y,H-y)*W
if s1 == s2:
    print(s1,1)
else:
    print(max(s1,s2),0)

Submission status: Wrong Answer

Solution code:
#C問題
W,H,x,y = map(int,input().split())
s1 = min(x,W-x)*H
s2 = min(y,H-y)*H
if s1 == s2:
    print(s1,1)
else:
    print(min(s1,s2),0)

Submission status: Wrong Answer

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

ans1 = min((W-x)*H, x*H)
ans2 = min(W*(H-y), W*y)

print(max(ans1,ans2), 1 if ans1 == ans2 else 0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, input().split())  # 複数数値入力

yoko = min((w-x)*h, x*h)
tate = min((h-y)*w, y*w)


if yoko == tate:
    print(str(yoko) + " 1")
else:
    print(str(max(yoko, tate))+ " 0")

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())  # 複数数値入力

yoko = min((w-x)*h, x*h)
tate = min((h-y)*w, y*w)


if yoko == tate:
    print(str(yoko) + " 1")
else:
    print(str(max(yoko, tate))+ " 0")

Submission status: Wrong Answer

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

S = W * H / 2

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

print(S, flag)

Submission status: Wrong Answer

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

p = min(w-x,x) * h
q = w * min(h-y,y)

if p == q:
  print(p, 1)
else:
  print(max(p,q),0)
#print(p,q)

Submission status: Wrong Answer

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

print("{0} {1}".format(ans, flg))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
	W, H, x, y = map(int, input().split())
	a = W*H/2
	p = 0
	if x == W//2 and y == H//2:
		p = 1
	print(" ".join([str(a), str(p)]))


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():
    W, H, X, Y = map(int, input().split())
    print(W * H, int(X * 2 == W and Y * 2 == H))

input = lambda: stdin.readline()
main()

Submission status: Wrong Answer

Solution code:
def solve(w, h, x, y):
    if (x in [0, w]) or (y in [0, h]):
        return (w*h/2, 0)
    area = max(min(x*h, (w-x)*h), min(w*y, w*(h-y)))
    multiple = int((2*x == w) and (2*y == h))
    return (area, multiple)

w, h, x, y = map(int, input().split())
print("%f %d" % solve(w, h, x, y))

Submission status: Wrong Answer

Solution code:
def solve(w, h, x, y):
    if (x in [0, w]) or (y in [0, h]):
        return (w*h//2, 0)
    area = max(min(x*h, (w-x)*h), min(w*y, w*(h-y)))
    multiple = int((2*x == w) and (2*y == h))
    return (area, multiple)

w, h, x, y = map(int, input().split())
print("%f %d" % solve(w, h, x, y))

Submission status: Wrong Answer

Solution code:
def solve(w, h, x, y):
    area = max(min(x*h, (w-x)*h), min(w*y, w*(h-y)))
    multiple = int((2*x == w) and (2*y == h))
    return (area, multiple)

w, h, x, y = map(int, input().split())
print("%f %d" % solve(w, h, x, y))

Submission status: Wrong Answer

Solution code:
def solve(w, h, x, y):
    area = max(min(x*h, (w-x)*h), min(w*y, w*(h-y)))
    multiple = int((2*x == w) or (2*y == h))
    return (area, multiple)

w, h, x, y = map(int, input().split())
print("%f %d" % solve(w, h, x, y))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
is_multiple_answer = 0
if H*x == W*y:
  is_multiple_answer = 1

near_center = abs(H/2 - H+y)/H if abs(H/2 - H+y)/H < abs(W/2 - W+x)/W else abs(W/2 - W+x)/W

answer = (0.5-near_center) * (W*H)
print(answer,is_multiple_answer)

Submission status: Wrong Answer

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


W,H,x_0,y_0 = map(float, input().split())

S = "{0:.6f}".format(float(W*H/2))
if W == 2 * x_0 or H == 2 * y_0:
    print(S, 1)
else:
    print(S, 0)

Submission status: Wrong Answer

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


W,H,x_0,y_0 = map(float, input().split())

S = "{0:.6f}".format(float(W*H/2))
if W == 2 * x_0 and H == 2 * y_0:
    print(S, 0)
else:
    print(S, 1)

Submission status: Wrong Answer

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


W,H,x_0,y_0 = map(float, input().split())

S = "{0:.6f}".format(float(W*H/2))
if W == 2 * x_0 or H == 2 * y_0:
    print(S, 0)
else:
    print(S, 1)

Submission status: Wrong Answer

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


W,H,x_0,y_0 = map(float, input().split())

if W == 2 * x_0 and H == 2 * 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,(w+h==x/2+y/2)+0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w,x,y = map(int,input().split())
t = h*w
hy = h*y
hx = t - hy
wx = w*x
wy = t -wx
l = [hy,hx]
L = [wx,wy]
a = min(l)
b = min(L)
if ((x == 0) or (x ==h)) and ((y == 0) or (y == w )):
  print(0,0)
elif a > b:
  print(a,0)
elif a < b :
  print(b,0)
else :
  print(a,1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
W,H,x_0,y_0 = map(float, input().split())

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

Submission status: Wrong Answer

Solution code:
h,w,x,y = map(int,input().split())
t = h*w
hy = h*y
hx = t - hy
wx = w*x
wy = t -wx
l = [hy,hx]
L = [wx,wy]
a = min(l)
b = min(L)
if a > b:
  print(a,0)
elif a < b :
  print(b,0)
elif x == (0 or h) and y == (0 or w ):
  print(0,0)
else :
  print(a,1)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split())
w1 = (w - x) * h
w2 = x * h
h1 = (h - y) * w
h2 = y * w
count = 0
ans = max(min(w1,w2),min(h1,h2))
if min(w1,w2) == min(h1,h2):
    count = 1
print(ans,count)