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(c) for c in input().split())

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

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 or y != h/2:
    print((w * h) / 2)
    print(0)

elif x != w/2 and y != h/2:
    print((w * h) / 2)
    print(0)

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, 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)
p = min(a, b)
q = min(c, d)
s = max(p, q)
flag = 0

if p < q:
    if s == a and s == b:
        flag = 1
else:
    if s == c and s == d:
        flag = 1

print(s, flag)

Submission status: Wrong Answer

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

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

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 or y != h/2:
    print((w * h) / 2)
    print(0)

Submission status: Wrong Answer

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

print("{:f} {}".format(float(W * H), abs(1 - int(x * 2 == W and y * 2 == H))))

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 not x or not y:
    print(W*H/2,0)
elif x/W==y/H or x/W==(H-y)/H:
    print(W*H/2,0)
else:
    print(max(min(x*H,(W-x)*H),min(y*W,(H-y)*W)),0)
"""else:
    print(max(min(x*H,(W-x)*H),min(y*W,(H-y)*W),min(H*H*x/y,H*W-H*H*x/y),min(W*W*y/x,H*W-W*W*y/x)),0)"""

Submission status: Wrong Answer

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

print("{:f} {}".format(float(W * H), int(x * 2 == W and y * 2 == H)))

Submission status: Wrong Answer

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

if x == w and y == h:
    print(w * h)
    print(1)

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 and y != h/2:
    print((w * h) / 2)
    print(0)

Submission status: Wrong Answer

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

if x == w and y == h:
    print(w * h)
    print(1)

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 or y != h/2:
    print((w * h) / 2)
    print(0)

Submission status: Wrong Answer

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

if x == w and y == h:
    print(x * h)
    print(1)

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 or y != h/2:
    print((w * h) / 2)
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == w and y == h:
    print(x * h)
    print(1)

elif x == w/2 and y == h/2:
    print((w * h) / 2)
    print(1)

elif x != w/2 or y != w/2:
    print((w * h) / 2)
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans_2 = 0
if x + x == w & y + y == h:
    ans_2 = 1
else:
    ans_2 = 0

print(float(w) * float(h) / 2, ans_2)

Submission status: Wrong Answer

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

a=[]
a.append(w*min(x, w-x))
a.append(h*min(y, h-y))
a.append(min(x, w-x)*min(y, h-y)//2)
cut = 0
if a.count(max(a)>1):
  cut=1 

print(max(a), cut)

Submission status: Wrong Answer

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

a=[]
a.append(w*min(x, w-x))
a.append(h*min(y, h-y))
a.append(min(x, w-x)*min(y, h-y)/2)
cut = 0
if a.count(max(a)>1):
  cut=1 

print(max(a), cut)

Submission status: Wrong Answer

Solution code:
inp=list(map(int,input().split()))
if 2*inp[2]==inp[0] and 2*inp[3]==inp[1]:
  ans=1;
else:
  ans=0;
print('%d %d'%(inp[0]*inp[1]*0.5,ans))

Submission status: Wrong Answer

Solution code:
inp=list(map(int,input().split()))
if 2*inp[2]==inp[0] and 2*inp[3]==inp[1]:
  ans=0;
else:
  ans=1;
print('%d %d'%(inp[0]*inp[1]*0.5,ans))

Submission status: Wrong Answer

Solution code:
str = input()
W = int(str.split()[0])
H = int(str.split()[1])
x = int(str.split()[2])
y = int(str.split()[3])
a = 0
b = 0
t = []
c = 0
d = 0
e = 0
if ((W == x and H == y) or (x == 0 and y == 0)) :
		a = W * H / 2
		b = 0
else :
	Z = W * H
	if (x != 0 and x != W) :
		if (x * H < Z - x * H) :
			t.append(x * H)
		else :
			t.append(Z - x * H)
	if (x != 0 and y != 0) :
		if (H * x / y < W) :
			st = H * x / y * H / 2
		else :
			st = W * y / x * W / 2
		if (st < Z - st) :
			t.append(st)
			c = st
		else :
			t.append(Z - st)
			c = Z - st
	if (x != 0 and y != H) :
		xt = -1 *  x * H / (y - H)
		if (xt > W) :
			st = W * ((y - H) / x * W + H) / 2
		else :
			st = xt * H / 2
		if (st < Z - st) :
			t.append(st)
			d = st
		else :
			t.append(Z - st)
			d = Z - st
	if (y != 0 and y != H) :
		if (W * y < Z - W * y) :
			t.append(W * y)
		else :
			t.append(Z - W * y)
	if (y != 0 and x != W) :
		xt = (y / (W - x) * W - H) * (W - x) / y
		if (xt >= 0) :
			st = (W - xt) * H / 2
		else :
			st = W * y / (W - x) * W / 2
		if (st < Z - st) :
			t.append(st)
			if (d == st) :
				e = 1
		else :
			t.append(Z - st)
			if (d == st) :
				e = 1
	if (x != W and y != H) :
		yt = H -  (H - y) / (W - x) * W
		if (yt >= 0) :
			st = W * (H - yt) / 2
		else :
			st = (W - ((H - y) / (W - x) * W - H) * (W - x) / (H - y)) * H / 2
		if (st < Z - st) :
			t.append(st)
			if (c == st) :
				e = 1
		else :
			t.append(Z - st)
			if (c == st) :
				e = 1
	a = 0
	b = 0
	for i in t:
		if (a < i) :
			a = i
			b = 0
		elif (a == i) :
			if (e == 0) :
				b = 1

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

Submission status: Wrong Answer

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

ans_1 = float(w) * float(h) / 2

ans_2 = 0
if x + x == w & y + y == h:
    ans_2 = 1
else:
    ans_2 = 0

print(ans_1, ans_2)

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(H*W, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = (int(i) for i in input().split())
if (w/2,h/2) == (x,y):
    print(h*w/2,1)
else:
    ans1 = min(h*x,h*(w-x))
    ans2 = min(w*y,w*(h-y))
    print(max(ans1,ans2),0)

Submission status: Wrong Answer

Solution code:

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

else:
    print("{:.9f}".format(menseki), '0')

Submission status: Wrong Answer

Solution code:

W,H,x,y = map(float,input().split())
width = min(x, W-x)
height = min(y, H-y)
menseki_1 = width*H
menseki_2 = height*W
menseki = max(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())
hw = W / 2
hh = H / 2
if x <= hw and y <= hh:
    if x * H > y * W:
        print(str(x * H) + ".0000000 0")
    elif x * H == y * W:
        print(str(x * H) + ".0000000 1")
    else:
        print(str(y * W) + ".0000000 0")
elif x <= hw and y >= hh:
    if x * H > (H - y) * W:
        print(str(x * H) + ".0000000 0")
    elif x * H == (H - y) * W:
        print(str(x * H) + ".0000000 1")
    else:
        print(str((H - y)* W) + ".0000000 0")
elif x >= hw and y <= hh:
    if (W - x) * H > y * W:
        print(str((W - x) * H) + ".0000000 0")
    elif (W - x) * H == y * W:
        print(str((W - x) * H) + ".0000000 1")
    else:
        print(str(y * W) + ".0000000 0")
else:
    if (W - x) * H > (H - y) * W:
        print(str((W - x) * H) + ".0000000 0")
    elif (W - x) * H == (H - y) * W:
        print(str((W - x) * H) + ".0000000 1")
    else:
        print(str((H - y) * W) + ".0000000 0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (x==0 or x==W) or (y==0 or y==H) or x*H == W*y or x*H+W*y==W*H:
    print(W*H/2, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (x == 0 or x == W) or (y == 0 and y == H) or (W == H and (x == y or x + y == W)):
    print(W*H/2, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

Submission status: Wrong Answer

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

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

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

if x == 0 and y == 0:
    j = 0

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))

Submission status: Wrong Answer

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

if (x == 0 or x == W) or (y == 0 and y == H):
    print(W*H/2, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

Submission status: Wrong Answer

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

if (x == 0 or x == W) and (y == 0 and y == H):
    print(W*H/2, 0)
elif x == 0 or x == W:
    print(W*min(y,H-y), 0)
elif y == 0 and y == H:
    print(min(x,W-x)*H, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (x == 0 or x == W) and (y == 0 and y == H):
    print(W*H, 1)
elif x == 0 or x == W:
    print(W*min(y,H-y), 0)
elif y == 0 and y == H:
    print(min(x,W-x)*H, 0)
else:
    S = W*min(y,H-y)
    T = min(x,W-x)*H
    counter = 0
    if S == T:
        counter += 1
    print(max(S,T), counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
str = input()
W = int(str.split()[0])
H = int(str.split()[1])
x = int(str.split()[2])
y = int(str.split()[3])
a = 0
b = 0
t = []
if ((W == x and H == y) or (x == 0 and y == 0)) :
		a = W * H / 2
		b = 0
else :
	Z = W * H
	if (x != 0 and x != W) :
		if (x * H < Z - x * H) :
			t.append(x * H)
		else :
			t.append(Z - x * H)
	if (x != 0 and y != 0) :
		if (H * x / y < W) :
			st = H * x / y * H / 2
		else :
			st = W * y / x * W / 2
		if (st < Z - st) :
			t.append(st)
		else :
			t.append(Z - st)
	if (x != 0 and y != H) :
		xt = -1 *  x * H / (y - H)
		if (xt > W) :
			st = W * ((y - H) / x * W + H) / 2
		else :
			st = xt * H / 2
		if (st < Z - st) :
			t.append(st)
		else :
			t.append(Z - st)
	if (y != 0 and y != H) :
		if (W * y < Z - W * y) :
			t.append(W * y)
		else :
			t.append(Z - W * y)
	if (y != 0 and x != W) :
		xt = (y / (W - x) * W - H) * (W - x) / y
		if (xt >= 0) :
			st = (W - xt) * H / 2
		else :
			st = W * y / (W - x) * W / 2
		if (st < Z - st) :
			t.append(st)
		else :
			t.append(Z - st)
	if (x != W and y != H) :
		yt = H -  (H - y) / (W - x) * W
		if (yt >= 0) :
			st = W * (H - yt) / 2
		else :
			st = (W - ((H - y) / (W - x) * W - H) * (W - x) / (H - y)) * H / 2
		if (st < Z - st) :
			t.append(st)
		else :
			t.append(Z - st)
	a = 0
	b = 0
	for i in t:
		if (a < i) :
			a = i
			b = 0
		elif (a == i) :
			b = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if w == x*2 and h == y*2:
    ans.append('{:.7f}'.format(w*h/2))
    ans.append(1)
else:
    num = []
    num.append(min((w-x)*h, x*h))
    num.append(min(w*(h-y), w*y))
    ans.append('{:.7f}'.format(max(num)))
    ans.append(0)

print(*ans, sep=' ')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(w * h / 2, cnt)

Submission status: Wrong Answer

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

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

elif (y == H / W * x or (y == -(H*x/W) + H) or y == H / 2 or x == W / 2):
  print(H*W / 2, 0)

else:
  print(max(min(x*H, 1-x*H), min(y*W, 1-y*W)))

Submission status: Wrong Answer

Solution code:


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

    flag = 0    
    if W + W == x and H + H == y:
        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())
print(max(min(x*H,(W-x)*H),min(y*W,(H-y)*W)),sum([x/W==y/H]))

Submission status: Wrong Answer

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

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

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())
print(min(max(x*H,(W-x)*H),max(y*W,(H-y)*W)),sum([x/W==y/H]))

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(float,input().split()))
#横にラインを引く

if float(x) == W/2.0 or float(y) == H/2.0:
    print('{:9e}'.format(W*H/2.0),'1')
else:
    print('{:9e}'.format(W*H/2.0),'0')

Submission status: Wrong Answer

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

S_max = float(W*H/2)
pl = 0

if x == int(W/2):
  if y == int(H/2):
    pl = 1
  
print(str(S_max) + " " + str(pl))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = (int(_) for _ in input().split())
area = w*h / 2
midh = h // 2
midw = h // 2
if x == midw and y == midh:
    yes = 1
else:
    yes = 0
print(area, yes)

Submission status: Wrong Answer

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

S = min(x, W-x) * H
T = W * min(y, H-y)

if S == T:
    print(S, 1)
else:
    print(max(S, T), 0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = (int(_) for _ in input().split())
area = w*h / 2
midh = h // 2
midw = h // 2
if x == midw or y == midh:
    yes = 1
else:
    yes = 0
print(area, yes)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8# coding: utf-8
W, H, x, y = map(int, input().split())
w = W - x
h = H - y
one = [h*W, y*W]
two = [w*H, x*H]
ans = max(min(one), min(two))
if 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())
print(float(W)*float(H)/2, x*2 == W and y*2 == H)

Submission status: Wrong Answer

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


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


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

#print("{:.2f}".format(w*h/2.0), ans)
print(w*h, ans)
#print((10**10-1)/2.0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
ans = [min(x * h, (w - x) * h), min(y * w, (h - y) * w)]

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

Submission status: Wrong Answer

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

f = False
if x*2 == W and y*2 == H:
  f = True
if f:
  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 w==w//2 and y==h//2:
    print(w*h/2,1)
else:
    print(w*h/2,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#C問題、間違ってそうだから最後に提出

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
ans = [min(x * h, (w - x) * h), min(y * w, (h - y) * w)]

if w // 2 == x and h // 2 == y:
    print(str((h * w) / 2) + ' 1')
else:
    print(str(max(ans)) + ' 0')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


def main():
    w, h, x, y = map(int, input().split())
    s = w * h / 2

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans.append('{:.7f}'.format(w*h/2))

if x > 0 and y > 0:
    if w % x == 0 and h % y == 0:
        ans.append(1)
else:
    ans.append(0)

print(*ans, sep=' ')

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [W, H, x, y] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2]), long(input_raw[3])]
    if (H /2 == y) and  (H % 2 == 0)  and (W/2 == x) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0

    if(W * y == H * x or y * W ==  (-H * x) + W * H):
        print "%20.15f %d" % (float(H)/2.0 * W , ans2)
        return

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

    ans = max(min(H - y, y) * W, min(W - x, x) * H)
    print "%20.15f %d" % (ans, ans2)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (x, y) != (W//2, 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())
area = W * H
if W==x*2 and W==y*2:
    print(float(area)/2, 1)
else:
    print(float(area)/2, 0)

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

        
    
        
    if abs(x/W - 0.5) > (abs(y/H - 0.5)):
        result = min(W * (y), W * (H - y))

    elif abs(x/W - 0.5) < (abs(y/H - 0.5)):
        result = min(H * (x), H * (W - x))
    
    else:
        result = min(H * (x), H * (W - x),W * (y), W * (H - y))
        
    result = H * W /2


    print(result,flag)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


def main():
    w, h, x, y = map(int, input().split())
    s = w * h / 2

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# 2019/06/16
# AtCoder Beginner Contest 130 - C

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

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

# Output
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
hoge = input().split()
W = int(hoge[0])
H = int(hoge[1])
x = int(hoge[2])
y = int(hoge[3])

ans1 = W*H/2

if W == H and x == y:
  ans2 = 1
else:
  ans2 = 0

print(ans1,ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = raw_input().split(" ")
W,H,x,y = map(lambda s: int(s), i)
tops = [(0,0), (W,0), (0, H), (W, H)]
menseki = []
for _w, _h in tops:
    menseki.append(float(abs(_w - x)) * float(abs(_h - y)))
menseki.sort(reverse=True)
if menseki.count(menseki[1]) > 1:
    print('{:f} 1'.format(menseki[1]))
else:
    print('{:f} 0'.format(menseki[1]))

Submission status: Wrong Answer

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

def on(W, H, x, y):
    check = 0
    if x == 0 or y == 0 or x == W or y == H:
        check = 1
    return check

check = on(W, H, x, y)
other = 0
if x == W // 2 and y == H // 2:
    other = 1
if check == 1:
    other = 0

on_line = 0
if H * x + W * y == H or H * x - W * y == 0:
    on_line = 1
    
if x > W // 2:
    x = W - x
if y > H // 2:
    y = H - y

min_area = max(0, x*H, y*W)
if x*H == y*W:
    other = 1
min_area = max(min_area, 0.5 * W * H)
print(min_area, other)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [W, H, x, y] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2]), long(input_raw[3])]
    if (H /2 == y) and  (H % 2 == 0)  and (W/2 == x) and (W % 2 == 0):
        ans2 = 1
    else:
        ans2 = 0

    if(W * y == H * x or y * W ==  (-H * x) + W * H):
        print "%20.15f %d" % (float(H)/2.0 * W , ans2)
        return

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

    ans = max(min(H - y, y) * W, min(W - x, x) * H)
    print "%20.15f %d" % (ans, ans2)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
w, h, x, y = input().split()
w, h, x, y = int(w), int(h), int(x), int(y)
if (x==0) or (y==0) or (x==w/2) or (y==h/2) or (x==w) or (y==h):
    if (x==w/2) and (y==h/2):
        print(w*h/2, 1)
    else:
        print(w*h/2, 0)
else:
    if (x < w/2) and (y < h/2):
        p = (h-y)/(w-x)
        x_pos = (p*x-y)/p
        print((w-x_pos)*h/2, 0)
    elif (x > w/2) and (y < h/2):
        p = (h-y)/-x
        x_pos = (p*x-y)/p
        print(x_pos*h/2, 0)
    elif (x < w/2) and (y > h/2):
        p = -y/(w-x)
        x_pos = (h-y+p*x)/p
        print((w-x_pos)*h/2, 0)
    elif (x > w/2) and (y > h/2):
        p = y/x
        x_pos = (h-y+p*x)/p
        print(x_pos*h/2, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

A = input()

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

S1 = x * H
S2 = (W-x) * H
if (S1>S2):
  S3 = S2
else:
  S3 = S1

S4 = (H-y) * W
S5 = y * W

if(S4>S5):
  S6 = S5
else:
  S6 = S4


if(S3>S6):
  Ans = S3
  pat = 0
elif(S3==S6):
  Ans = S3
  pat = 1
else:
  Ans = S6
  pat = 0

print("{} {}".format(Ans,pat))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S_max = float(W*H/2)
pl = 0

if x != 0:
  if x == (int(W/2)):
    if y == (int(H/2)):
      pl = 1
    else:
      pl = 0
  else:
    pl = 0
else:
  pl = 0
  
print(str(S_max) + " " + str(pl))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
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):
    print(Decimal((W * H) / 2), 0)
    sys.exit()

if ((y == (W / H) * x or y == H - (H / W) * x)) and (x, y) != (W / 2, H / 2):
    print(W * H / 2, str(0))
    sys.exit()

if (x, y) == (W / 2, H / 2):
    print(W * H / 2, str(1))
    sys.exit()

if (3 / 2) * x == W and y == H:
    print(x * H / 2 , 1)
    sys.exit()
if 3 * x == W and y == H:
    print(x * H, 1)
if (3 / 2) * y == H and x == W:
    print(y * W / 2, 1)
    sys.exit()
if 3 * y == H and x == W:
    print(y * W, 1)
        

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S_max = float(W*H/2)
pl = 0

if x != 0:
  if x == (int(W/2)):
    pl = 1
    if y == (int(H/2)):
      pl = 1
    else:
      pl = 0
  else:
    pl = 0
else:
  pl = 0
  
print(str(S_max) + " " + str(pl))