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 = [int(x) for x in input().split()]
if (x == W/2 and y != H/2) or (x != W/2 and y == H/2) or (x == W and y == H) or (x == W and y == 0) or (x == 0 and y == H) or (x == 0 and y == 0):
    print('{:.6f}'.format(W*H/2),0)
else:
    print('{:.6f}'.format(W*H/2),1)

Submission status: Wrong Answer

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

if W - 2*x == 0:
    if H - 2*y == 0:
        high = H/2
    else:
        high = 0
else:
    high = (H*W - W*y - H*x) / (W - 2*x)     # 縦に2分割する時の、Wのy座標
print(high)

if H - 2*y == 0:
    if W - 2*x == 0:
        width = W/2
    else:
        width = 0
else:
    width =  (H*W - W*y - H*x) / (H - 2*y)   # 横に2分割する時の、Hのx座標
print(width)

if (high > 0 and high < H) and (width > 0 and width < W):
    ans = 1
else:
    ans = 0
    
print(W*H/2, ans)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
temp1 = [(W-x)*H,x*H]
temp2 = [W*y,W*(H-y)]

ans = max(min(temp1),min(temp2))
if min(temp1) == min(temp2) or (W/2 == x and H/2 == y):
    print(ans,1)
else:
    print(ans,0)

Submission status: Wrong Answer

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

S = W * H

a = x * H
b = S - a
c = y * W
d = S - c

k = max(a, b)
l = max(c, d)

flag = 0
if k < l:
    s = k
    if s == c or s == d:
        flag = 1
else:
    s = l
    if s == a or s == b:
        flag = 1
if [x, y] == [0, 0] or [x, y] == [0, H] or [x, y] == [W, 0] or [x, y] == [W, H]:
    flag = 0

print(s * 1.0, flag)

Submission status: Wrong Answer

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

a_x = min(x, W - x)
a_y = min(y, H - y)

if (W < H):
    l = H
    m = a_x
else:
    l = W
    m = a_y

ans = l * m

if (x == W/2 and y == H/2):
    multi_ans = 1
elif (W == H and (x != 0 or y != 0)):
    multi_ans = 1
else:
    multi_ans = 0

print("{} {}".format(ans, multi_ans))

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
  Num = list(map(int,input().split(" ")))
  Result1 = 0
  Result2 = 0
  
  if Num[2] == 0 or Num[3] == 0:
    Result1 = 0
  else:
    if Num[1] / 2 > Num[3]:
      Mem1 = (Num[0] * Num[3]) / 2
    else:
      Mem1 = (Num[0] * (Num[1]-Num[3]))
    if Num[0] / 2 > Num[2]:
      Mem2 = (Num[1] * Num[2])/2
    else:
      Mem2 = (Num[1] * (Num[0] - Num[2]))
    if Mem1 > Mem2:
      Result1 = Mem1
    else:
      Result1 = Mem2
  
  if Num[2] == Num[0] / 2 and Num[3] == Num[1] / 2:
    print(str(Result1) + " 1")
  else:
    print(str(Result1) + " 0")

Submission status: Wrong Answer

Solution code:
#整数＋リスト
w, h, x, y = list(map(int, input().split()))

xx = x
if (x > w/2):
    xx = w - x

yy = y
if (y > h/2):
    yy = h - y

a = xx*h
b = yy*w

if (a == b):
    print('{0:.6f}'.format(a), 1)
else:
    if (a < b):
        a = b
    print('{0:.6f}'.format(a), 0)

Submission status: Wrong Answer

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

if x == w / 2 and y == h / 2:
  print(w*h/2, 1)
elif x == w / 2 or y == h / 2:
  print(w*h/2, 0)
else:
  w1 = min(w-x, x) + max(y/h, (h-y)/h)
  w2 = min(w-x, x) + min(y/h, (h-y)/h)
  a1 = (w1+w2) * h / 2
  h1 = min(h-y, y) + max(x/w, (w-x)/w)
  h2 = min(h-y, y) + min(x/w, (w-x)/w)
  a2 = (h1 + h2) * w / 2
  if a1 == a2:
    print(a1, 1)
  else:
    print(max(1, a2), 0)

Submission status: Wrong Answer

Solution code:
import collections
w, h, x, y = map(int, input().split())
area = []
# xの直線
area.append(min(h*x, h*(w-x)))

# yの直線
area.append(min(w*y, w*(h-y)))

# 角たち
a = w * h
if y != 0:
    if h / y * x <= w:
        tmp = h / y * x * h
        area.append(min(tmp, a - tmp))
if h - y != 0:
    if h / (h - y) * x <= w:
        tmp = h / (h - y) * x * h
        area.append(min(tmp, a - tmp))

if x != 0:
    if w / x * y <= h:
        tmp = w / x  * y * w
        area.append(min(tmp, a - tmp))
if w - x != 0:
    if w / (w - x) * y <= h:
        tmp = w / (w - x) * y * w
        area.append(min(tmp, a - tmp))


ans_c = collections.Counter(area)

ans = sorted(ans_c.items(), reverse=True)[0]
size = ans[0]
a = 0
if ans[1] > 1:
    a = 1

print("{} {}".format(size, a))

Submission status: Wrong Answer

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

counter = 0
if x == W/2:
    counter+=1

if y == H/2:
    counter+=1

if counter == 0:
    print(W*H/2, 0)
else:
    print(W*H/2, 1)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split())
if x == 0 and y == 0:
    print(w*h/2,"0")
elif x==0:
    print(min(w*y,w*(h-y)),"0")
elif y==0:
    print(min(h*x,h*(w-x)),"0")
elif w-x==w/2 and h-y == h/2:
    print(max(min(w*y,w*(h-y)),min(h*x,h*(w-x))),"1")
else:
    print(max(min(w*y,w*(h-y)),min(h*x,h*(w-x))),"0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

candidate1 = [x*H, (W-x)*H]
candidate2 = [W*y, W*(H-y)]

min1 = min(candidate1)
min2 = min(candidate2)
max12 = max(min1, min2)

if min1 != min2:
    way = 0
else: way = 1

print(max12, way)

Submission status: Wrong Answer

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

def main():
    if (x, y) in [(0, 0), (0, H), (W, 0), (W, H)]:
        print(W * H / 2, "1")
        return
    r1 = min(x * H, (W-x) * H)
    r2 = min(y * W, (H-y) * W)
    print(max(r1, r2), "1" if r1 == r2 else "0")
main()

Submission status: Wrong Answer

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

x2 = W-x
y2 = H-y

a = float(H * x)
b = float(H * x2)
c = float(W * y)
d = float(W * y2)

ans = max(min(a,b),min(c,d))

flag = 0

if abs(min(a,b) - min(c,d)) < 0.000000001:
    flag = 0

print(ans,flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
width = max(x, W-x)
height = max(y, H-y)
menseki_1 = width*H
menseki_2 = height*W
menseki = min(menseki_2,menseki_1)
if menseki_1 ==menseki_2:
    print("{:.9f}".format(menseki), '1')
    
else:
    print("{:.9f}".format(menseki), '0')

Submission status: Wrong Answer

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

else:
    cou = 0
    if min(W-x,x)*H == min(H-y,y)*W:
        cou = 1
    ans = min(min(W-x,x)*H,min(H-y,y)*W)
    print(str(ans)+' '+str(cou))

Submission status: Wrong Answer

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

area = max(min((W - x) * H, x * H), min((H - y) * W, y * W))

num = 0

if (x, y) == (0, 0) or (x, y) == (W, H) or (x, y) == (W, 0) or (x, y) == (0, H) or abs(x) == abs(y):
    print((W * H) / 2, 0)
    sys.exit()

if min((W - x) * H, x * H) == min((H - y) * W, y * W):
    num = 1
else:
    num = 0

print(area, num)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    W, H, x, y = map(int, input().split())
    n = 0
    M = W * H
    n = max(n, min(M - x * H, M))
    n = max(n, min(M - W * y, M))
    print(n, "1" if x*2 == W and y*2 == H else "0")

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s = W*H
s1 = x*H
s2 = W*y
s3 = min(x+y, H) * min(x+y, W) // 2

s1 = min(s1, s-s1)
s2 = min(s2, s-s2)
s3 = min(s3, s-s3)
sa = max(s1, s2, s3)

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(i) for i in input().split()]
def S1(W, H, x, y):
    w = W / 2
    if(x <= w):
        return H * x
    else:
        return H * (W - x)
def S2(W, H, x, y):
    h = H / 2
    if(y <= h):
        return W * y
    else:
        return W * (H - y)

def S3(W, H, x, y):
    if((W * H) % 2 == 0):
        return W * H // 2
    else:
        return W * H / 2


ans1 = max(S1(W, H, x, y), S2(W, H, x, y), S3(W, H, x, y))
if((S1(W, H, x, y) ==  S3(W, H, x, y)) or (S2(W, H, x, y) == S3(W, H, x, y))):
    ans2 = 1
else:
    ans2 = 0

print(str(ans1) + " " + str(ans2))

Submission status: Wrong Answer

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

for i, j in [[0, 0], [W, 0], [W, H], [0, H]]:
    if x == i and y == j:
        print(W * H / 2, 0)
        quit()

s1 = float(min(W - x, x) * H)
s2 = float(W * min(H - y, y))
ans1 = max(s1, s2)
ans2 = int(x * H == W * y)
print(ans1, ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import fractions

if x * 2 == W or y * 2 == H:
	c = 1
else:
	x1 = fractions.Fraction(H * x - y * W, H - 2 * y)
	y1 = fractions.Fraction(W * y - x * H, W - 2 * x)
	
	if 0 <= x1 <= W and 0 <= y1 <= H:
		if (x1 == 0 or x1 == W) and (y1 == 0 or y1 == H):
			c = 0
		else:
			c = 1
	else:
		c = 0
	
	
	

print(W * H / 2, c)

Submission status: Wrong Answer

Solution code:
def main():

    w,h,x,y=list(map(int,input().split()))
    if(x==w/2 and y==h/2):
        s=w*h/2
        print(s,1)
    
    elif(x==w/2 or y==h/2):
        s=w*h/2
        print(s,0)

    else:
        s_11=w*(h-y)
        s_12=w*y
        S1=max([s_11,s_12])
        s_21=h*x
        s_22=h*(w-x)
        S2=max([s_21,s_22])

        if S1==S2:
            print(S1,1)
        else:
            S=max([S1,S2])
            print(S,0)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
def input(): return sys.stdin.readline().strip()

# N = int(input())
# L = [int(x) for x in input().split()]
W, H, x, y = map(int, input().split())
# S = input()

ko = [-1] * 3
ko[0] = min(x * H, (W - x) * H)
ko[1] = min(y * W, (H - y) * W)
if (x == 0 or y == 0) or y / x == H / W:
    ko[2] = (W * H) / 2

maxm = max(ko)
print(maxm, 1 if ko.count(maxm) > 1 else 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x2 = W-x
y2 = H-y

a = float(H * x)
b = float(H * x2)
c = float(W * y)
d = float(W * y2)

ans = max(min(a,b),min(c,d))

flag = 0

if abs(min(a,b) - min(c,d)) < 0.000000001:
    flag = 1

print(ans,flag)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
a = float(w * abs(h - y))
b = float(w * y)
diff1 = abs(a-b)

c = float(abs(w - x) * h)
d = float(h * x)
diff2 = abs(c-d)

if diff1 == diff2:
    print(str(max(max(a, b), max(c,d))) + " 1")
elif diff1 < diff2:
    print(str(max(a, b)) + " 0")
elif diff2 < diff1:
    print(str(max(c, d)) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
flag=0
X=min([W-x,x])
Y=min([H-y,y])
#print(X,Y)
if X*H<Y*W:
    print(Y*W,0)
elif X*H==Y*W:
    print(X*H,1)
else:
    print(X*H,0)

Submission status: Wrong Answer

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

x1=x*h
x2=(w-x)*h
y1=y*w
y2=(h-y)*w

if x==0 and y==0 or x==w and y==0 or x==0 and y==h or x==w and y==h:
    a=1/2*w*h
else:    
    a=max(min(x1,x2),min(y1,y2))
if min(x1,x2)==min(y1,y2):
    b=1
else:
    b=0
    
print(a,b)

Submission status: Wrong Answer

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

x_min = min(x, W - x)
y_min = min(y, H - y)

ans = [None, None]
ans[1] = 1 if x_min * H == y_min * W else 0
if ans[1] == 1:
    print(x_min * H, 1)
elif x_min > y_min:
    print(y_min * W, 0)
else:
    print(x_min * H, 0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
w, h, x, y = map(int, input().split())
s = w * h
# x = 
s1 = min(x * h, s - x * h)
# y = 
s2 = min(y * w, s - y * w)
# y = (y/x)x
s3 = 0
if x != 0 and y != 0:
    if (y / x) < (h / w):
        s3 = w * ((y / x) * w) / 2
    else:
        s3 = h * (h / (y / x)) / 2

ans = max(s1, s2, s3)

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

print("{} {}".format(ans, ans2))

Submission status: Wrong Answer

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

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


S=w*h/2

print(str(S)+' '+str(s))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
hw = W / 2
hh = H / 2
if x <= hw and y <= hh:
    if x * H > y * W:
        A = x * H
        print(str(A) + ".000000 0")
    elif x * H == y * W:
        print(str(x * H) + ".000000 1")
    else:
        print(str(y * W) + ".000000 0")
elif x <= hw and y > hh:
    if x * H > (H - y) * W:
        print(str(x * H) + ".000000 0")
    elif x * H == (H - y) * W:
        print(str(x * H) + ".000000 1")
    else:
        print(str((H - y)* W) + ".000000 0")
elif x > hw and y <= hh:
    if (W - x) * H > y * W:
        print(str((W - x) * H) + ".000000 0")
    elif (W - x) * H == y * W:
        print(str((W - x) * H) + ".000000 1")
    else:
        print(str(y * W) + ".000000 0")
else:
    if (W - x) * H > (H - y) * W:
        print(str((W - x) * H) + ".000000 0")
    elif (W -x) * H == (H - y) * W:
        print(str((W - x) * H) + ".000000 1")
    else:
        print(str((H - y) * W) + ".000000 0")

Submission status: Wrong Answer

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

# 判定
if W*y == H*x:
    judge = 1

# 面積求める
area1 = W * y
area2 = W*H - area1
area1_2 = min(area1,area2)
area3 = x * H
area4 = W*H - area3
area3_4 = min(area3,area4)

ans = max(area1_2,area3_4)

if (x,y) == (0,0) or (x,y) == (W,0) or (x,y) == (0,H) or (x,y) == (W,H):
    ans = (W * H)/2

print("{0:.6f}".format(ans), judge)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int,input().split())
s = (w*h)/2
if x == int(w/2) and y == int(h/2):
  print(s, 1)
elif x == 0:
  print(s, 0)
elif y == 0:
  print(s, 0)
elif x == w:
  print(s, 0)
elif y == h:
  print(s, 0)
else:
  s1 = x*h
  s2 = s*2-s1
  s3 = y*w
  s4 = s*2-s3
  s5 = min(s1,s2)
  s6 = min(s3,s4)
  s7 = max(s5,s6)
  print(s7, 0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s = W*H
s1 = x*H
s2 = W*y
s3 = min(x+y, H) * min(x+y, W) // 2

s1 = min(s1, s-s1)
s2 = min(s2, s-s2)
s3 = min(s3, s-s3)
sa = max(s1, s2, s3)

print(sa, 1)

Submission status: Wrong Answer

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

b = 0
if x == y:
    b = 1

print('{} {}'.format((W*H)/2, b))

Submission status: Wrong Answer

Solution code:
W,H,x,y =map(int ,raw_input().split())
i = 0
if x*2 == W and y +2 ==H:
    i = 1
print float(W*H)/2,i

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x>w/2:
    x=w-x
if y>h/2:
    y=h-y
a=x*h
b=w*y

if a!=b and x!=w/2 and y!=h/2:
    print(max(a,b),0)
else:
    print(max(a,b),1)

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 == 0) or (x == W and y == 0) or (x == 0 and y == H):
    print(W*H, 1)
else:
    # 横分割の時の最小値を求める
    A = min((H-y)*W, y*W)

    # 縦分割の時の最小値を求める
    B = min((W-x)*H, x*H)

    # 最後に最大の方を選ぶ
    # このときA=Bなら複数あるということ
    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())

X = H * x
if X > (W - x) * H:
  X = (W - x) * H

Y = y * W
if Y > W * (H - y):
  Y = W * (H - y)

if X == 0 or Y == 0 or X == x or Y == y:
  print(W * H / 2, 0)
  exit()

if X > Y:
  print(X, 0)
elif X < Y:
  print(Y, 0)
elif X == Y:
  print(X, 1)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

if (x,y) == (0,0) or (x,y) == (0,H) or (x,y) == (W,0) or (x,y) == (W,H):
    ans = 0
    ans_2 = 0
elif x*H == y*W or (W-x)*H == y*W:
    ans = H*W/2
    if float(x) == W/2 and float(y) == H/2:
        ans_2 = 1
    else:
        ans_2 = 0
else:
    yoko_a = W * y
    yoko_b = W * (H-y)
    yoko = min(yoko_a, yoko_b)

    tate_a = H * x
    tate_b = H * (W-x)
    tate = min(tate_a, tate_b)
    
    ans = max(tate, yoko)
    ans = float(ans)

    if tate == yoko:
        ans_2 = 1
    else:
        ans_2 = 0

print(ans, ans_2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 中心
if x==W/2 and y==H/2:
    print(AREA/2,1)
# 辺の上
elif x==0 or x==W or y==0 or y==H:
    print(AREA/2,0)
# 対角線上
elif y==H/W*x or y== -H/W*x + H:
    print(AREA/2,0)
else:
    area_x = H * (min(x, W-x))
    area_y = (min(y,H-y) * W)

    print(max(area_x, area_y), end=' ')
    print(1 if area_x == area_y else 0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s = W*H
s1 = x*H
s2 = W*y
s3 = min(x+y, H) * min(x+y, W) // 2

s1 = min(s1, s-s1)
s2 = min(s2, s-s2)
s3 = min(s3, s-s3)
sa = max(s1, s2, s3)

if x == 0 or y == 0:
    print(sa, 0)
else:
    print(sa, 1)

Submission status: Wrong Answer

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

# xで分割する場合
xres = min((W-x)*H, W*H - (W-x)*y)

# yで分割する場合
yres = min(W*(H-y), W*H - x*(H-y))

check = 1 if xres == yres else 0

if x == 0 and y == 0:
    res = W*H
elif x == 0 and y == H:
    res = W*H
elif x == W and y == 0:
    res = W*H
elif x == W and y == H:
    res = W*H
else:
    res = W*H/2

print(res, check)

Submission status: Wrong Answer

Solution code:
#整数＋リスト
w, h, x, y = list(map(int, input().split()))

xx = x
if (x > w/2):
    xx = w - x

yy = y
if (y > h/2):
    yy = h -y

a = xx*h
b = yy*w

if (a < b):
    a = b

if (a == b):
    print('{0:.6f}'.format(a), 1)
else:
    print('{0:.6f}'.format(a), 0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
flag = 0
if (W-x)*H > x*H:
        ans1 = x*H
elif (W-x)*H == x*H:
        ans1 = x*H
        flag = 1
elif (W-x)*H < x*H:
        ans1 = (W-x)*H

if (H-y)*W >= y*W:
        ans2 = y*W
elif (H-y)*W == y*W:
        ans2 = y*W
        flag = 1
elif (H-y)*W < y*W:
        ans2 = (H-y)*W

if ans1 > ans2:
        print(str('{:.6f}'.format(ans1)) + ' ' + str(flag))
elif ans1 == ans2:
        flag = 1
        print(str('{:.6f}'.format(ans1)) + ' ' + str(flag))
elif ans1 < ans2:
        print(str('{:.6f}'.format(ans2)) + ' ' + str(flag))

Submission status: Wrong Answer

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


if w == 0 or h == 0:
    print(0,0)

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

    print(h*w/2, num)

Submission status: Wrong Answer

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


ans1_1 = W * (H - y)
ans1_2 = W * y

ans2_1 = x * H
ans2_2 = (W - x) * H

if (x == 0 and y == 0) or (x == W and y == H) or (x == 0 and y == H) or (x == W and y == 0):
    print(W * H / 2, 0)
    
elif x == 0 or x == W :
    print(W * (y + (H - y))/2, 0)
    
elif y == 0 or y == H:
    print(H * (x + (W - x))/2, 0)
    
elif abs(ans1_1 - ans1_2) <  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 0)
    
elif abs(ans1_1 - ans1_2) ==  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 1)
    
else:
    print(min(ans2_1, ans2_2), 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])

def main():
    mx = w - x    
    my = h - y
    m1 = mx*h
    m2 = my*w
    m3 = x * h
    m4 = y * w
    minv1 = min([m1,m3])
    minv2 = min([m2,m4])
    res = max((minv2, minv1))
    allc = [m1,m2,m3,m4]
    if minv2 != minv1:
        res2 = 0
    else:
        res2 = 1
    print(float(res), res2)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

sq0 = W*H/2
sq1 = (W/2 - abs(W/2 - x)) * H
sq2 = W * (H/2 - abs(H/2 - y))

if x == 0 or x == W or y == 0 or y == H: print(sq0, 0)
elif W*y == H*x or W*y == -H*x + W*H: print(sq0, 0)
elif sq1 == sq2: print(sq1, 1)
elif sq1 > sq2: print(sq1, 0)
elif sq1 < sq2: print(sq2, 0)

Submission status: Wrong Answer

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

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

if x>=W//2:
    res = (W-x)*H
else:
    res = x*H

if y>=H//2:
    res2 = (H-y)*W
else:
    res2 = y*W

res3 = 0
if x==y*W/H or x==(H-y)*W/H:
    res3 = H*W/2

print("{} {}".format(max([res,res2,res3]),is_double))

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 == 0) or (x == W and y == 0) or (x == 0 and y == H):
    print(W*H, 0)
else:
    # 横分割の時の最小値を求める
    A = min((H-y)*W, y*W)

    # 縦分割の時の最小値を求める
    B = min((W-x)*H, x*H)

    # 最後に最大の方を選ぶ
    # このときA=Bなら複数あるということ
    if A == B:
        print(A, 1)
    else:
        print(max(A, B), 0)

Submission status: Wrong Answer

Solution code:
def main():

    w,h,x,y=list(map(int,input().split()))
    if(x==w/2 and y==h/2):
        s=w*h/2
        print(s,1)
    
    elif(x==w/2 or y==h/2):
        s=w*h/2
        print(s,0)

    else:
        s_11=w*(h-y)
        s_12=w*y
        S1=max([s_11,s_12])
        s_21=h*x
        s_22=h*(w-x)
        S2=max([s_21,s_22])

        S=max([S1,S2])
        print(S,0)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

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

vertical = min((w-x)*h, x*h)
horizontal = min((h-y)*w, w*y)

if vertical != horizontal:
	print(max(horizontal, vertical), 0)
else:
	print(vertical, 1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#n = int(input()) 
w,h,x,y = (int(i) for i in input().split())
s1=x*h
s2=h*w-s1
minx=min(s1,s2)
s3=y*h
s4=h*w-s3
miny=min(s3,s4)

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

Submission status: Wrong Answer

Solution code:
#
import sys
import math
import numpy as np
import itertools


# いくつか入力
w,h,x,y = (int(i) for i in input().split())  

if x > w//2:
    x = w - x
if y > h//2:
    y = h - y

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

Submission status: Wrong Answer

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

right_length = W - x
top_length = H -y 

width = min(W - x,x) 
height = min(H - y, y)

S_vertical = H * width
S_horizonal = W * height

flag = 0
if S_vertical == S_horizonal:
    flag = 1
S = max(S_vertical, S_horizonal)
if S == 0:
    S = W * H /2
    flag = 0

print(S,flag )

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split())
if x == 0 and y == 0:
    print(0,"0")
elif x==0:
    print(min(w*y,w*(h-y)),"0")
elif y==0:
    print(min(h*x,h*(w-x)),"0")
elif w-x==w/2 and h-y == h/2:
    print(max(min(w*y,w*(h-y)),min(h*x,h*(w-x))),"1")
else:
    print(max(min(w*y,w*(h-y)),min(h*x,h*(w-x))),"0")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if (x,y) == (0,0) or (x,y) == (0,H) or (x,y) == (W,0) or (x,y) == (W,H):
    ans = 0
    ans_2 = 1
elif x*H == y*W or (W-x)*H == y*W:
    ans = H*W/2
    if float(x) == W/2 and float(y) == H/2:
        ans_2 = 1
    else:
        ans_2 = 0
else:
    yoko_a = W * y
    yoko_b = W * (H-y)
    yoko = min(yoko_a, yoko_b)

    tate_a = H * x
    tate_b = H * (W-x)
    tate = min(tate_a, tate_b)
    
    ans = max(tate, yoko)
    ans = float(ans)

    if tate == yoko:
        ans_2 = 1
    else:
        ans_2 = 0

print(ans, ans_2)

Submission status: Wrong Answer

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

if x > 0 and x < W and y > 0 and y < H:
  rec_1 = W * min(y, H - y)
  rec_2 = H * min(x, W - x)
  multi = 0
  if rec_1 == rec_2:
    multi = 1
  print("{} {}".format(max(rec_1, rec_2), multi))
else:
  if (x == 0 or x == W) and (y == 0 or y == H):
    print("{} {}".format(H * W / 2, 0))
  elif x == 0 or x == W:
    print("{} {}".format(W * min(y, H - y), 0))
  else:
    print("{} {}".format(H * min(x, W - x), 0))

Submission status: Wrong Answer

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

if H-y>y:
    high=y
else:
    high=H-y

if W-x>x:
    wide=x
else:
    wide=W-x

if W*high==H*wide:
    j=1
    print(W*high," ",j)
elif W*high > H*wide:
    j=0
    print(W*high," ",j)
elif W*high < H*wide:
    j=0
    print(H*wide," ",j)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
S = round(float(W*H/2),10)
if W != H and W<10000:
  print('{:.10f}'.format(S), 0)
else:
  print('{:.10f}'.format(S),1)

Submission status: Wrong Answer

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

X = H * x
if X > (W - x) * H:
  X = (W - x) * H

Y = y * W
if Y > W * (H - y):
  Y = W * (H - y)

if X == 0 or Y == 0:
  print(W * H / 2, 0)
  exit()

if X > Y:
  print(X, 0)
elif X < Y:
  print(Y, 0)
elif X == Y:
  print(X, 1)

Submission status: Wrong Answer

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


if(x == W and y == H):
    ans = (H * W) / 2
    print('{0} {1}'.format(ans, '0'))

elif(x == W):
    ans = W * min(y, H-y)
    print('{0} {1}'.format(ans, '0'))

elif(y == H):
    ans = min(x, W-x) * H
    print('{0} {1}'.format(ans, '0'))

elif(x == W//2 and y == H//2):
    ans = (W * H) / 2
    print('{0} {1}'.format(ans, '1'))

elif(x == W//2):
    ans = x * H
    print('{0} {1}'.format(ans, '0'))

elif(y == H//2):
    ans = W * y
    print('{0} {1}'.format(ans, '0'))

else:
    ans = max((W * min(y, H-y)), (min(x, W-x) * H))
    print('{0} {1}'.format(ans, '0'))

Submission status: Wrong Answer

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

divide_x = (x * H, (W-x) * H)
divide_y = (W * y, W * (H-y))
max_value = max(min(divide_x), min(divide_y))
if min(divide_x) == min(divide_y):
    is_mullt_ans = '1'
else:
     is_mullt_ans = '0'

print(max_value, is_mullt_ans)

Submission status: Wrong Answer

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

SQ_1 = (W-x) * (H-y)
SQ_2 = x * (H-y)
SQ_3 = x*y
SQ_4 = (W-x) * y

yoko = min([SQ_1+SQ_2, SQ_3+SQ_4])
tate = min([SQ_1+SQ_4, SQ_2+SQ_3])

out = 0
flag = False
if yoko > tate:
  out = yoko
elif tate > yoko:
  out = tate
elif tate == yoko:
  out = tate
  flag = True
  
if yoko == 0 and tate == 0:
  out = 0

  
if flag:
  print(out, '1')
elif not flag:
  print(out, '0')

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
cnt = 0
flag = 0
area_1_x = x * H
area_2_x = (W-x) * H
area_1_y = y * W
area_2_y = (H-y) * W
if area_1_x > area_2_x:
    area_x = area_2_x
else:
    area_x = area_1_x
if area_1_y > area_2_y:
    area_y = area_2_y
else:
    area_y = area_1_y

if area_x > area_y:
    m = float(area_x)
    print('{:.6f}'.format(m),"0")
elif area_x == area_y:
    m = float(area_x)
    print('{:.6f}'.format(m),"1")
else:
    m = float(area_y)
    print('{:.6f}'.format(m),"0")

Submission status: Wrong Answer

Solution code:
W, H, x, y = list(map(int, input().split()))
res = 0
if (x == 0 and y == H) or (x == W and y == 0) or (x == W and y == H) or (x == 0 and y == 0):
  res = float(W * H)
elif (W - x) >= (H - y):
  res = float((W - x) * H)
else:
  res = float((H - y) * W)

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

print("{:f} {}".format(res, str(div_flg)))

Submission status: Wrong Answer

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

s = w*h/2

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

Submission status: Wrong Answer

Solution code:
def get_has_other_ans(x, y):
  if (x == 0 or y == 0 or x == w or y == h) :
    return 1
  else :
    return 0

w, h, x, y = [int(i) for i in input().split(" ")]
  
square1 = x * h
square2 = x * (y - h)
square3 = (w - x) * h
square4 = (w - x) * (y - h)

max = square1
if (max < square2):
  max = square2
  
if (max < square3):
  max = square3
  
if (max < square4):
  max = square4

has_other_ans = 0
if (x == y) :
  has_other_ans = 1

  
print(max, has_other_ans)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, raw_input().split())
x1 = x * H
x2 = (W-x) * H
y1 = y * W
y2 = (H-y) * W
max = max(min(x1, x2),min(y1, y2))
if min(x1, x2) == min(y1, y2) and min(x1, x2) != 0:
    print(str(max) + " 1")
else:
    print(str(max) + " 0")

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
 
if W-x < x:
    x = W-x
if H-y < y:
    y = H-y
 
if x*H > y*W: 
    print(y*W, "0")
elif x*H < y*W:
    print(x*H, "0")
else:
    print(x*H, "1")

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
W,H,x,y = map(Decimal,input().split())
O_x = W/2
O_y = H/2
if (float(x) == O_x) ^ (float(y) == O_y):
    print(W*H/2,0)
else:
    print(W*H/2,1)