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 = (float(_) for _ in input().split()) 
s_a = x*h
s_b = (w-x)*h
s_c = w*y
s_d = w*(h-y)

s_l_a = [s_a,s_b]
s_l_b = [s_c,s_d]

if min(s_l_a) > min(s_l_b):
    ans_0 =min(s_l_a)
else:
    ans_0 =min(s_l_b)

s_x = w/2
s_y = h/2

if s_x == x and s_y == y:
    ans =1
else:
    ans =0
print("{} {}".format(ans_0,ans))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
sq = 0
nearX = x - (float(w) / 2)
nearY = y - (float(h) / 2)

if nearY < nearX:
    sq = w * (float(h) / 2)
    print(str(sq) + ' ' + '0')
elif nearX < nearY:
    sq = h * (float(w) / 2)
    print(str(sq) + ' ' + '0')
else:
    sq = h * (float(w) / 2)
    if x == y and w == h:
        print(str(sq) + ' ' + '3')
    else:
        print(str(sq) + ' ' + '1')

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    W, H, x, y = LI()
    c_w, c_h = W/2, H/2
    way = 1
    if x == c_w and y == c_h:
        way = 0
    print("{} {}".format(W*H/2, way))
main()

Submission status: Wrong Answer

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

if 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:
def main():
    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 == int(w/2) or y == int(h/2):
        print(s, 0)
    else:
        print(s, 0)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    W, H, x, y = map(int, input().split())
    xleft, xright = x * H, (W - x) * H
    ydown, yup = W * y, W * (H -y)
    if x == 0 or x == W:
        if ydown == yup: print(ydown, 1)
        else: print(min(ydown, yup), 0)
    elif y == 0 or y == H:
        if xleft == xright: print(xleft, 1)
        else: print(min(xleft, xright), 0)
    else:
        ansx = min(xleft, xright)
        ansy = min(ydown, yup)
        if ansx == ansy:print(ansx, 1)
        else: print(max(ansx, ansy), 0)
    return

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

#sqA
sqA = min(H * x, H *(W - x))
#sqB
sqB = min(y * W, (H -y)*W)

print(sqA)
print(sqB)

if sqA == sqB:
   print('{0:.6f}'.format(max(sqA,sqB))+ ' ' + "1")
else:
   print('{0:.6f}'.format(max(sqA,sqB))+ ' '  + "0")

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
hukusuu=0
Wc=int(W/2)
Hc=int(H/2)

if Wc==x:
  if Hc==y:
    hukusuu=1
menseki=W*H/2

print(menseki, hukusuu)

Submission status: Wrong Answer

Solution code:
def inpl(): return list(map(int, input().split()))
W, H, x, y = inpl()
if x > W/2:
    x = W-x
if y > H/2:
    y = H-y

a = W*y
b = H*x
if a == b:
    print(a, 1)
elif a > b:
    print(a, 0)
else:
    print(b, 0)

Submission status: Wrong Answer

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

square_1 = (W - x) * H * 1.0

square_2 = W * (H - y) * 1.0

if square_1 == square_2:
    print(square_1, 1)
elif square_1 > square_2:
    print(square_1, 0)
else:
    print(square_2, 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

print(max(S_vertical, S_horizonal), ' ',flag )

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ta = (W-x)*H
yo = (H-y)*W
S = ta if ta >= yo else yo
bo = 1 if ta == yo else 0
print(S, bo)

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, 1)

Submission status: Wrong Answer

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

#round1
A1=min(x*y+(W-x)/2+(H-y)/2, W*H-(x*y+(W-x)/2+(H-y)/2))

#round2
A2=0
if A1==min(x*H,(W-x)*H) and A1==min(y*W,(H-y)*W):
  A2=1

print(A1,A2)

Submission status: Wrong Answer

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

if (x==0 and y==0) or (x==W and y==0) or (x==0 and y==H) or (x==W and y==H):
  print(W*H/2, 0)
else:
  S1,S2=H*x,(W-x)*H
  S3,S4=W*y,(H-y)*W

  print(max(min(S1,S2),min(S3,S4)), 1 if min(S1,S2)==min(S3,S4) else 0)

Submission status: Wrong Answer

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

ans1 = 1
ans2 = 0

diff1 = abs(a-b)

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

if diff1 == diff2:
    print(str(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:
def main():
    W, H, x, y = list(map(int, input().split()))

    multi_split = "0"
    if W > H:
        area = float(W) * y
    elif W < H:
        area = float(H) * x
    else:
        multi_split = "1"
        area = float(W) * y
    print("{:.6f} {}".format(area, multi_split))

if __name__ == '__main__':
    main()

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:
    sx = min(w * y, w * (h - y))
    sy = min(h * x, h * (w - x))
    print(max(sx, sy), 0)

Submission status: Wrong Answer

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

a = min(x,w-x)
s = h*a

b = min(y, h-y)
t = w*b

result = 0

if x == w/2 and y == h/2:
    result = 1

u = 0
if w == x and h == y:
    u = w*h/2
if x == 0 and y == h:
    u = w*h/2
if x == 0 and y == 0:
    u = w*h/2
if x == w and y == 0:
    u = w*h/2

v = 0
if x == 0 or x == w:
    temp = max(h-y,y)
    v = w*temp/2
    
if y == 0 or y == h:
    temp = max(w-x,x)
    v = h*temp/2


print(max(s,t,u,v),result)

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
A = H * (W-x)
B = H * x
C = W * (H - y)
D = W * y
E = min(A,B)
F = min(C,D)
if E > F:
    if A == B:
        print(E,1)
    else:
        print(E,0)
elif E == F:
    print(E,1)
else:
    if C == D:
        print(F,1)
    else:
        print(F,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:
import decimal
w,h,x,y = list(map(int, input().split()))

print("{0:.9f}".format((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())

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n=input().rstrip().split(" ")
for i in range(4):
    n[i]=int(n[i])
S=n[0]*n[1]
senter=[n[0]/2,n[1]/2]#1
dis=[n[2],n[3]]#2
a=senter[1]-dis[1]
b=dis[0]-senter[0]
if(senter[1]==dis[1] and senter[0]==dis[0]):
    print(str(S/2) +" "+str(1))
else:
    print(str(4) +  " "+ str(0))

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(s) for s in input().split()]
r1 = min(x * H, (W-x) * H)
r2 = min(y * W, (H-y) * W)
print(max(r1, r2), "1" if r1 == r2 else "0")

Submission status: Wrong Answer

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

out1 = W*H / 2

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

print("%f %d" % (out1, out2))

Submission status: Wrong Answer

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

sq = (W * H) / 2

someFlg = 1

if x == W / 2:
    someFlg = someFlg + 1
if y == H / 2:
    someFlg = someFlg + 1

someFlg = someFlg % 2

if x == 0 or y == 0 or x == W or y == H:
    someFlg = 0

print(str(sq) + " " + str(someFlg))

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    W, H, x, y = LI()
    c_w, c_h = W/2, H/2
    way = 1
    if x == c_w or y == c_h:
        way = 0
    print("{} {}".format(W*H/2, way))
main()

Submission status: Wrong Answer

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

s_a = x*h
s_b = (2-x)*h
s_c = w*y
s_d = w*(h-y)

s_l_a = [s_a,s_b]
s_l_b = [s_c,s_d]

if min(s_l_a) > min(s_l_b):
    ans_0 =min(s_l_a)
else:
    ans_0 =min(s_l_b)

s_x = w/2
s_y = h/2

if s_x == x and s_y == y:
    ans =1
else:
    ans =0
print("{} {}".format(ans_0,ans))

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
if (x == W and y == H) or (x == 0 or 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:
W, H, x, y = map(int, 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):
    print(str(max) + " 1")
else:
    print(str(max) + " 0")

Submission status: Wrong Answer

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

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

if any(a != 0 for a in A) and any(b != 0 for b in B):
    print(float(max(min(A), min(B))), 1)
elif not any(a != 0 for a in A):
    print(float(min(B)), 0)
else:
    print(float(min(A)), 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)
print("{0:.6f}".format(ans), judge)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,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 h==w-x or h-y == w:
    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())
first = min(x*h,(w-x)*h)
second =min(y*w,(h-y)*w)
if first == second:
        print(first,1)
else:
        print(max(first,second),0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == 0 or y == 0 or x == W or y == H:
    print(area/2, 0)
elif W == H and W % 2 == 0 and W//2==x and W//2==y:
    print(area/2, 1)
elif W == H and W % 2 == 0 and x+y==W or x==y:
    print(area/2, 0)
else:
    lr = H * min(H-y, y)
    ud = W * min(W-x, x)
    ans = max(lr, ud)
    if lr == ud:
        print(ans, 1)
    else:
        print(ans, 0)

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

print(max(xres, yres), check)

Submission status: Wrong Answer

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

print(W*H/2)

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

Submission status: Wrong Answer

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


a=abs(0-x)*H
b=abs(x-W)*H

c=abs(0-y)*W
d=abs(y-H)*W
if x!=W:xx=min(a,b)
else: xx=b
if y!=H:yy=min(c,d)
else: yy=d
ans=max(xx,yy)
res=1 if xx==yy else 0
if xx==yy and x==W and y==H:
    res=1

print('{} {}'.format(ans,res))

Submission status: Wrong Answer

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

if w==h:
    s=1
else:
    s=0


S=w*h/2

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

Submission status: Wrong Answer

Solution code:
# 2019 6/16
# ABC130 Rectangle Cutting

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

mid_W = W / 2
mid_H = H / 2

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

else:
    L = H * x
    R = H * (W - x)
    LR_div = min(L, R)

    U = W * (H - y)
    D = W * y
    UD_div = min(U, D)

    ans = max(LR_div, UD_div)

    print(ans, 0)

Submission status: Wrong Answer

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

Xeq = H * (W-x)
Yeq = W * (H-y)

judge = 0
if Xeq == Yeq:
    judge = 1

if Xeq < Yeq:
    print("{} {}".format(Yeq,judge))
else:
    print("{} {}".format(Xeq, judge))

Submission status: Wrong Answer

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

if W/2 == x and H/2 == y:
	S = W*H/2
	print("%f %d" % (S,1))
elif x == 0 or y == 0:
	print("0.000000 0")
else:
	S1 = min(x,W-x) * H
	S2 = min(y,H-y) * W
	if S1 == S2:
		print("%f %d" % (max(S1,S2),1))
	else:
		print("%f %d" % (max(S1,S2),0))

Submission status: Wrong Answer

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

tate_min = min((W - x) * H, x * H)
yoko_min = min((H - y) * W, y * W)

# 線上
if tate_min == 0 or yoko_min == 0:
  area = W * H / 2
  w = 0
else:
  area = max(tate_min, yoko_min)
  w = 1 if tate_min == yoko_min else 0

print(area, w)

Submission status: Wrong Answer

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

a = w * h / 2
b = int((x == w // 2) and (y == h // 2)) if (x != 0 and y != 0) else 0
print(str(a) + ' ' + str(b))

Submission status: Wrong Answer

Solution code:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
l=[]
l.append(a*b/2)
if a*d==b*c or a/2==c or b/2==d:
    l.append(1)
else:
    l.append(0)
for i in l:
    print(i,end=" ")

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(W * y == H * x or y * W ==  -H * x + W * H):
        print float(W)/2.0 * H , 1
        return

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

sq = w*h

qt1 = min(w*y,sq-w*y)
qt2 = min(h*x,sq-h*x)

print("{} {}".format(max(qt1,qt2),int(qt1==qt2)))

Submission status: Wrong Answer

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# a, b
# s = input()


W, H, x, y = map(int, input().split())
ans1 = str((W * H) / 2)

ans2 = "0"
cnt = 0
if H % 2 == 0 and y == H // 2:
    cnt += 1
if W % 2 == 0 and x == W // 2:
    cnt += 1

# nx = min(x, W - x)
# ny = min(y, H-y)
# if nx * Y == ny * X:
#     ans += 2
print(ans1, ans2)

Submission status: Wrong Answer

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

flg = 0

if x/w==y/h:
    flg = 1

s1 = (w-x)*h
s2 = (h-y)*w
s = max(s1,s2)


print(s,flg)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
w, h, x, y = map(int, input().split())

if x == 0 or y == 0:
    s1 = w * h / 2
    s2 = s1
    f = 0
else:
    s1 = x * h
    s2 = y * w
    f = 1 if s1 == s2 else 0

print("{} {}".format(float(min(s1, s2)), f))

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    x, a = LI()
    if x < a:
        print(0)
    else:
        print(10)
    return

#B
def B():
    n, x = LI()
    L = LI()
    ans = 0
    c = 1
    for i in L:
        ans += i
        if ans <= x:
            c += 1
            continue
        break
    print(c)
    return

#C
def C():
    W, H, x, y = LI()
    a = W * H / 2
    b = 0
    if W / H * x == y and - W / H * x + W == y:
        b = 1
    print(a,b)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = []
b = []
a.append(x * H)
a.append((W - x) * H)
b.append(y * W)
b.append((H - y) * W)
aMin = min(a)
bMin = min(b)
if aMin == bMin:
    print (str(aMin)+' 1')
else:
    ans = max([aMin, bMin])
    print (str(ans)+' 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)

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    W, H, x, y = map(int, input().split())
    xleft, xright = x * H, (W - x) * H
    ydown, yup = W * y, W * (H -y)
    ansx = min(xleft, xright)
    ansy = min(ydown, yup)
    if ansx == ansy:print(ansx, 1)
    else: print(max(ansx, ansy), 0)
    return

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

if any(a != 0 for a in A) and any(b != 0 for b in B):
    print(float(max(min(A), min(B))), end="")
    print(" ", 1 if min(W * y, W * (H - y)) == min(H * x, H * (W - x)) else 0)
elif not any(a != 0 for a in A):
    print(float(min(B)), 0)
else:
    print(float(min(A)), 0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, 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(W == H and x == y)
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
EPS = 1e-9

def main():
    buf = input()
    buflist = buf.split()
    W = int(buflist[0])
    H = int(buflist[1])
    x = int(buflist[2])
    y = int(buflist[3])
    area = []
    multiple = False
    # LR
    area.append(float(min(W * y, W * (H - y))))
    # UD
    area.append(float(min(x * H, (W - x) * H)))
    # diag LD
    if x + y <= H:
        if x + y <= W:
            area.append(min((x + y) * (x + y) / 2, W * H - ((x + y) * (x + y) / 2)))
        else:
            area.append(min(((x + y) + (x + y - W)) * W / 2, W * H - ((x + y) + (x + y - W)) * W / 2))
    else:
        if x + y <= W:
            area.append(min(((x + y - H) + (x + y)) * H / 2, W * H - ((x + y - H) + (x + y)) * H / 2))
        else:
            area.append(min((2 * H - x + y) * (2 * W - x + y) / 2, W * H - ((2 * H - x + y) * (2 * W - x + y) / 2)))
    # diag LU
    W, H, x, y = H, W, y, x
    if x + y <= H:
        if x + y <= W:
            area.append(min((x + y) * (x + y) / 2, W * H - ((x + y) * (x + y) / 2)))
        else:
            area.append(min(((x + y) + (x + y - W)) * W / 2, W * H - ((x + y) + (x + y - W)) * W / 2))
    else:
        if x + y <= W:
            area.append(min(((x + y - H) + (x + y)) * H / 2, W * H - ((x + y - H) + (x + y)) * H / 2))
        else:
            area.append(min((2 * H - x + y) * (2 * W - x + y) / 2, W * H - ((2 * H - x + y) * (2 * W - x + y) / 2)))
    area.sort()
    if area[-1] - area[-2] < EPS:
        multiple = True
    print(area[-1], 1 if multiple else 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 and (W - x) != 0 and y / x == (H - y) / (W - x):
    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())
menseki = w * h
res1 = 0
tmp = 0
res2 = 0
if menseki % 2 == 0:
    if x * h <= y * w:
        tmp = x
    else:
        tmp = y
# y = h/w*x
if x == h//2 and y == w//2:
    res2 = 1
else:
    res2 = 0
print(menseki/2, res2)

Submission status: Wrong Answer

Solution code:
n=input().split()
for i in range(4):
    n[i]=int(n[i])
a=n[0]*n[1]
b=(n[0]-n[2])*n[1]
c=(n[1]-n[2])*n[0]
if b==c:
    s=1
else:
    s=0
if b<c:
    print(str(b)+" "+str(s))
else:
    print(str(c)+" "+str(s))

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(i) for i in input().split()]
if W == H:
    print("{:.10f}".format(W * H / 2), 1)
else:
    ans = 0
    if W < H:
        ans = H * min(W - x, x)
    else:
        ans = W * min(H - y, y)
    print("{:.10f}".format(ans), 0)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import random
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def main():

	#N = int(input())
	W, H, x, y = map(int, input().split(" "))
	#L = list(map(int, input().split(" ")))

	ans1 = 0
	ans2 = 0

	if x == W/2 and y == H/2:
		#print(1)
		ans2 = 1
	elif W-x == H-y and W == H:
		#print(2)
		ans2 = 1
	elif abs(W-x) == abs(H-y)and W == H:
		#print(3)
		ans2 = 1
	elif W-x == H-(H-y)and W == H:
		#print(4)
		ans2 = 1

	yoko = 0
	if x <= W/2:
		yoko = x
	else:
		yoko = W-x
	
	tate = 0
	if y <= H/2:
		tate = y
	else:
		tate = H-y

	if yoko <= tate:
		ans1 = yoko*H
	else:
		ans1 = tate*W

	#print("{} {}".format(tate, yoko))
	print("{} {}".format(ans1, ans2))



if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

if w/2 == x and h/2 == y:
  way=1
  s=w*h/2

elif x == 0 or x == w or y == 0 or y== h:
  way=1
  s=0

else:
  oy,yh,ox,xw=y,h-y,x,w-x
  yoko=min(oy*w,yh*w)
  tate=min(ox*h,xw*h)
  way=0
  s=max(yoko,tate)

print(float(s),way)

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):
    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:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
area = w * h
if (x, y) in ((0, 0), (w, 0), (w, h), (0, h)):
    print(area / 2, 1)
    exit()
verticalCutArea = (h - y) * w
max1 = min(verticalCutArea, area - verticalCutArea)
horizontalCutArea = h * (w - x)
max2 = min(horizontalCutArea, area - horizontalCutArea)
print(max(max1, max2), 1 if max1 == max2 else 0)

Submission status: Wrong Answer

Solution code:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
l=[]
l.append(a*b/2)
if a*d==b*c or a==c or b==d:
    l.append(1)
else:
    l.append(0)
for i in l:
    print(i,end=" ")

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

Submission status: Wrong Answer

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

#sqA
sqA = min(H * x, H *(W - x))
#sqB
sqB = min(y * W, (H -y)*W)



if sqA == sqB:
   print('{0:.6f}'.format(min(sqA,sqB))+ ' ' + "1")
else:
   print('{0:.6f}'.format(min(sqA,sqB))+ ' '  + "0")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
W,H,x,y = [int(i) for i in input().split(" ")]
diff_x = x if (x < (W - x)) else (W-x)
diff_y = y if (y < (H - y)) else (H-y)
if W == H:
    double_ans = 1
else:
    double_ans = 0

ans1 = diff_x * H * 1.0
ans2 = diff_y * W * 1.0
ans = max(ans1, ans2)
#if W < H:
    #ans = (W / 2.0) * H
#else:
    #ans = (H / 2.0) * W
print("%s %d" % (str(ans), double_ans))

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(0,1)
# 対角線上
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:
li = list(map(int, input().split()))
W = li[0]  # よこ
H = li[1]  # たかさ
x = li[2]
y = li[3]

menseki = W * H

# 縦に分割
split_x_menseki = x * H
x_ookikunai = min(menseki - split_x_menseki, split_x_menseki)

# 横に分割
split_y_menseki = W * y
y_ookikunai = min(menseki - split_y_menseki, split_y_menseki)

split_flag = 0

if x_ookikunai == y_ookikunai:
    split_flag = 1

print(max(y_ookikunai, x_ookikunai), split_flag)