Problem:


Score : 300 points

Problem Statement

There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).
You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

Print the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.

The area printed will be judged correct when its absolute or relative error is at most 10^{-9}.

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

The line x=1 gives the optimal cut, and no other line does.

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1



Sample input:
2 3 1 2


Sample output:
3.000000 0

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
check = 0
area = w * h
max_min = max(min(x / w,(w-x)/w),min(y/h,(h-y)/h))
if min(x / w,(w-x)/w) == min(y/h,(h-y)/h):
  check = 1
print(area * max_min,check)

Submission status: Wrong Answer

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

WS = min(x, W - x) * H
HS = min(y, H - y) * W

ans1 = max(WS, HS)

ans2 = 0
if x * 2 == W and y * 2 == H:
    ans2 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

WS = min(x, W - x) * H
HS = min(y, H - y) * W

ans1 = max(WS, HS)

ans2 = 0
if WS == HS:
    ans2 = 1

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

Submission status: Wrong Answer

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

s_0 = min(x * h, (w - x) * h)
s_1 = min(w * y, w * (h - y))

print(max(s_0, s_1), 1 if s_0 == s_1 else 0)

Submission status: Wrong Answer

Solution code:
# Problem C - Rectangle Cutting

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

# initialization
# area 1
tmp_1 = H * x
tmp_2 = H * (W - x)
ans_1 = min(tmp_1, tmp_2)

# area 2
tmp_3 = W * y
tmp_4 = W * (H - y)
ans_2 = min(tmp_3, tmp_4)

# output
if ans_1==ans_2:
    ans_list = [ans_1, 1]
    print(" ".join(list(map(str, ans_list))))
else:
    ans_num = max(ans_1, ans_2)
    ans_list = [ans_num, 0]
    print(" ".join(list(map(str, ans_list))))

Submission status: Wrong Answer

Solution code:
w, h ,x, y=map(int, input().split())
m1=min((w-x)*h, x*h)
m2=min((h-y)*w, y*w)

ans=max(m1, m2)

if m1 == m2:
    p=1
else:
    p=0

print(ans, p)

Submission status: Wrong Answer

Solution code:
w, h ,x, y=map(int, input().split())
m1=min((w-x)*h, x*h)
m2=min((h-y)*w, y*w)

ans=max(m1, m2)

if w-x == x and h-y == y and x == y and w == h:
    p=1
else:
    p=0

print(ans, p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = max(min(s1), min(s2))
if min(s1) == 0:
  print(min(s2), 0)
if min(s2) == 0:
  print(min(s1), 0)

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

Submission status: Wrong Answer

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

if x == 0:
  print()

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

Submission status: Wrong Answer

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

if (x == 0 and y == 0) or (x==0 and y==h) or (x==w and y==0) or(x==w and y==h):
    print(w*h/2,'0')
    exit()

a = min(x*h,(w-x)*h)
b = min(y*w,(h-y)*w)
tmp = '0'
if a == b:
    tmp = '1'
print(max(a,b),tmp)

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)
tmp = '0'
if a == b:
    tmp = '1'
print(max(a,b),tmp)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s1 = [x*H, (W-x)*H]
s2 = [y*W, (H-y)*W]
ans = max(min(s1), min(s2))

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

Submission status: Wrong Answer

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def area(x1, y1, x2, y2):
    return abs(x2 - x1) * abs(y2 - y1)




def solve():
    w, h, x, y = MI()

    # 縦
    ha1 = area(0, 0, x, h)
    ha2 = area(x, 0, w, h)
    areah = min(ha1, ha2)

    # 横
    wa1 = area(0, 0, w, y)
    wa2 = area(0, y, w, h)
    areaw = min(wa1, wa2)

    if areah == areaw:
        print(areah, 1)
    else:
        print(max(areaw, areah), 0)

    # def in_area(a, b):
    #     if 0 <= a <= x and 0 <= b <= y:
    #         return True
    #     else:
    #         return False
    #
    # # 斜め


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
if 2*x==w and 2*y==h:
  q=1
else:
  q=0
p=[max(min(x*h,(w-x)*h),(min(y*w,(h-y)*w))),q]
print(*p)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if ((a-c)*b)>(a*(b-d)):
    print(str((a-c)*b)+' 0')
elif ((a-c)*b)==(a*(b-d)):
    print(str((a-c)*b)+' 1')
else:
    print(str(a*(b-d))+' 0')

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
if (x!=w/2 and y==h/2) or (x==w/2 and 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())
if min(x,w-x)*h == min(y,h-y)*w:
     print(max(min(x, w - x) * h, min(y, h - y) * w), 1)
else:
     print(max(min(x, w - x) * h, min(y, h - y) * w), 0)

Submission status: Wrong Answer

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

is_center = x * 2 == W and y * 2 == H
min_square = W * H / 2

print(min_square, is_center)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    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)

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:k=1
elif w/2==x or h/2==y:k=0
elif w==h:k=0
else:k=1
print(w*h/2,k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (x == w // 2 and y == h // 2) and w % 2 == 0 and h % 2 == 0:
    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())

s = w * h / 2
flg = 0

if (x == w // 2 and y == h // 2) and w % 2 == 0 and h % 2 == 0:
    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())

s = w * h / 2
flg = 0

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

print("{} {}".format(s, flg))

Submission status: Wrong Answer

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

    if x * 2 == w :
        flg +=1
    if y * 2 == h :
        flg +=1

    if x * h == w * y :
        flg += 1


    ans = max(w * y, h*x)
    if ans * 2 > w*h:
        ans = min(w*y,h*x)

    if flg == 1:
        print(w*h/2, 0)
    elif flg > 1:
        print(w*h/2, 1)
    else:
        print(ans, 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    w,h,x,y = map(int,input().split())
    flg = 0
    if x == 0 or y == 0:
        print(0,0)
        return
    if x * 2 == w :
        flg +=1
    if y * 2 == h :
        flg +=1

    if x * h == w * y :
        flg += 1


    ans = max(w * y, h*x)

    if flg == 1:
        print(w*h/2, 0)
    elif flg > 1:
        print(w*h/2, 1)
    else:
        print(ans, 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
flg = 0
if x * 2 == w :
    flg +=1
if y * 2 == h :
    flg +=1

if x * h == w * y :
    flg += 1


ans = max(w * y, h*x)

if flg == 1:
    print(w*h/2, 0)
elif flg > 1:
    print(w*h/2, 1)
else:
    print(ans, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(w*h /2 , x+x == w and y+ y ==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)
else:
    print(w*h/2, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

area = (W * H) / 2
div = 0
if W * H != 0 and W // 2 == x and H // 2 == y:
    div = 1

print(area, div)

Submission status: Wrong Answer

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

area = (W * H) / 2
div = 0
if W * H * x * y != 0 and W // 2 == x and H // 2 == y:
    div = 1

print(area, div)

Submission status: Wrong Answer

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

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

print(area, div)

Submission status: Wrong Answer

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

area = W * H / 2
div = 0
if W // 2 == x and H // 2 == y:
    div = 1

print(area, div)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
hy=W*(H-y)
by=W*y
rx=(W-x)*H
lx=x*H
arry={hy,by}
arrx={rx,lx}
miny=min(arry)
minx=min(arrx)
ans=max({miny,minx})
print(str(ans)+" "+("1" if len(arry)==1 and len(arrx)==1 else "0"))

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
hy=W*(H-y)
by=W*y
rx=(W-x)*H
lx=x*H
arry={hy,by}
arrx={rx,lx}
miny=min(arry)
minx=min(arrx)
ans=max({miny,minx})
cnt=0
for val in arry:
  if ans==val:
    cnt+=1
for val in arrx:
  if ans==val:
    cnt+=1
print(str(ans)+" "+("0" if cnt==1 else "1"))

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
hy=W*(H-y)
by=W*y
rx=(W-x)*H
lx=x*H
arry={hy,by}
arrx={rx,lx}
miny=min(arry)
minx=min(arrx)
ans=max({miny,minx})
cnt=-1
for val in arry:
  if ans==val:
    cnt+=1
for val in arrx:
  if ans==val:
    cnt+=1
print(str(ans)+" "+str(cnt))

Submission status: Wrong Answer

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

ans = 0
count = 0
if x == y:
    ans = min(x*H, (W-x)*H)
    count = 1
elif x < y:
    ans = min(x*H, (W-x)*H)
else:
    ans = min(y*W, (H-y)*W)

print(ans, count)

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:
    ans = [W*H/2, 1]
    print(*ans)
else:
    ans = [W*H/2, 0]
    print(*ans)

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:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
if x == w and y == h:
    area = area / 2
area = format(area, '.6f') if area != 0 else 0
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Submission status: Wrong Answer

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
area = format(area, '.6f') if area != 0 else 0
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Submission status: Wrong Answer

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
if x == w and y == h:
    x = y = 0
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
area = format(area, '.6f') if area != 0 else 0
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Submission status: Wrong Answer

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
if x == w and y == h:
    x = y = 0
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
area = format(area, '.6f') if area != 0 else 0
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area,addit))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = list(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:
w,h,x,y = list(map(int, input().split()))

if((x == w//2 and y == h//2) or (x == h//2 and y == w//2)):
  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()))

if(x == w//2 or y == h//2 or x == h//2 or y == w//2):
  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()))

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

Submission status: Wrong Answer

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


a = max(min(x*h, (w-x)*h), min(y*w, (h-y)*w))

if(w == h):
  print(a/1.0,1)
else:
  print(a/1.0,0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=input().split()
w=int(w)
h=int(h)
x=int(x)
y=int(y)
d1=w*(h-y)
d2=w*y
d3=h*(w-x)
d4=h*x
if d1==d2 and d3==d4:
    print(float(d1),1)
    exit()
if d1==d2:
    print(float(d1),0)
    exit()
if d3==d4:
    print(float(d3),0)

Submission status: Wrong Answer

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


a = max(min(x*h, (w-x)*h), min(y*w, (h-y)*w))

if(min(x*h, (w-x)*h) == min(y*w, (h-y)*w)):
  print(a/1.0,1)
else:
  print(a/1.0,0)

Submission status: Wrong Answer

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

area = w * h / 2

if x == y:
    flg = 1
else:
    flg = 0
    
print(area, flg)

Submission status: Wrong Answer

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

area = w * h // 2

if x == y:
    flg = 1
else:
    flg = 0
    
print(area, flg)

Submission status: Wrong Answer

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

a1 = x * h
a2 = (w - x) * h
a = min(a1, a2)

b1 = w * y
b2 = w * (h - y)
b = min(b1, b2)

area = max(a, b)

if x == y:
    flg = 1
else:
    flg = 0
    
print(area, flg)

Submission status: Wrong Answer

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

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:
W, H, x, y = map(int, input().split())

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

if a[0] == a[1] == a[2] == a[3]:
    print('{} {}'.format(a[0], 1))
    exit()

a.sort()

print('{} {}'.format(a[-2], 0))

Submission status: Wrong Answer

Solution code:
A, B, C, D = map(int, input().split())
if(C == A//2 and D == B//2):
  print(A*B/2, 1)
else:
  print(A*B/2, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = [int(i) for i in input().split()]
print(w * h / 2, int(x != (w / 2) and y != (h / 2)))

Submission status: Wrong Answer

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

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:
  half = W * H // 2
  print(half)
  print(0)
  exit()
holizontal = min(W * y,W * (H-y))
vertical = min(H * x,H * (W - x))
print(max(holizontal,vertical))
print(0)
exit()

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
holizontal = min(W * y,W * (H-y))
vertical = min(H * x,H * (W - x))
print(max(holizontal,vertical))
hasMulti = True
if x == 0 or x == W or y == 0 or y == H:
  hasMulti= False
if hasMulti:
  print(1)
else:
  print(0)
exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
print('{} {}'.format(str(w*h/2), str(0 + (x == w//2 and y == h//2))))

Submission status: Wrong Answer

Solution code:
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

w,h,x,y = load_list()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

else:
    area_H = sorted([x * H, (W - x) * H])
    area_W = sorted([y * W, (H - y) * W])

    area_h = area_H[0]
    area_w = area_W[0]

    area = sorted([area_h, area_w])
    switch = int(area[0] == area[1])

    print("{} {}".format(float(area[1]), switch))

Submission status: Wrong Answer

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

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

else:
    area_H = sorted([x * H, (W - x) * H])
    area_W = sorted([y * W, (H - y) * W])

    area_h = area_H[0]
    area_w = area_W[0]

    area = sorted([area_h, area_w])
    switch = int(area[0] == area[1])

    print("{} {}".format(float(area[1]), switch))

Submission status: Wrong Answer

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

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

else:
    area_H = sorted([x * H, (W - x) * H])
    area_W = sorted([y * W, (H - y) * W])

    area_h = area_H[0]
    area_w = area_W[0]

    area = sorted([area_h, area_w])
    switch = int(area[0] == area[1])

    print("{} {}".format(float(area[1]), switch))

Submission status: Wrong Answer

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

area_H = sorted([x * H, (W - x) * H])
area_W = sorted([y * W, (H - y) * W])

area_h = area_H[0]
area_w = area_W[0]

area = sorted([area_h, area_w])
switch = int(area[0] == area[1])

print("{} {}".format(float(area[1]), switch))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

S = W * H
all_S = []
sita = S * (y / H)
ue = S - sita
all_S.append(min(sita, ue))
hidari = S * (x / W)
migi = S - hidari
all_S.append(min(hidari, migi))
max_S = max(all_S)
print(max_S, end=' ')
if all_S[0] == all_S[1]:
    print('1')
else:
    print('0')

Submission status: Wrong Answer

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

S = W * H
all_S = []
sita = S * (y / H)
ue = S - sita
all_S.append(min(sita, ue))
hidari = S * (x / W)
migi = S - hidari
all_S.append(min(hidari, migi))
#all_S = [sita, hidari, ue, migi]
max_S = max(all_S)
#all_S.remove(min_S)
print(max_S, end=' ')
#print(int(bool(all_S.count(min_S))))
if all_S[0] == all_S[1]:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

S = W * H
sita = S * (y / H)
ue = S - sita
hidari = S * (x / W)
migi = S - hidari
all_S = [sita, hidari, ue, migi]
min_S = min(all_S)
all_S.remove(min_S)
print(min_S, end=' ')
print(int(bool(all_S.count(min_S))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print('{:.7f}'.format(ans*w*h), end=" ")
#print(ans*w*h, end=" ")
if min(x/w, (w-x)/w)==min(y/h,(h-y)/h):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

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


ans = max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print('{:.6f}'.format(ans*w*h), end=" ")
#print(ans*w*h, end=" ")
if min(x/w, (w-x)/w)==min(y/h,(h-y)/h):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

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

ans = 0.000000000
ans = ans + max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print('{:.10f}'.format(ans*w*h), end=" ")
#print(ans*w*h, end=" ")
if min(x/w, (w-x)/w)==min(y/h,(h-y)/h):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

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

ans = 0.000000000
ans = ans + max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print(ans*w*h, end=" ")
if min(x/w, (w-x)/w)==min(y/h,(h-y)/h):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

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

ans = max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print(ans*w*h, end=" ")
if min(x/w, (w-x)/w)==min(y/h,(h-y)/h):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


ax = x*H
bx = (W-x)*H
cx = abs(ax - bx)
ay = y*W
by = (H-y)*W
cy = abs(ay - by)
if cx < cy:
    print(max(ax,bx), 0)
elif cx>cy:
    print(max(ay,by), 0)
else:
    print(max(ax, bx), 1)

Submission status: Wrong Answer

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

area = W*H*0.5
if(x == W/0.5 and y == H/0.5):
    frac = "1"
else:
    frac = "0"

print(area, frac)

Submission status: Wrong Answer

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

def ans(a, b, c, d):
    if (c == a / 2) and (b == b / 2):
        return 0
    else:
        return 1
        
print(W * H / 2,ans(W, H, x, y))

Submission status: Wrong Answer

Solution code:
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def input_list():
  return list(map(int, input().split()))

def input_list_str():
  return list(map(str, input().split()))

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def main():
  w, h, x, y = input_list()
  if w == h:
    print(w, 1)
    exit(0)
  if x < y:
    print(x*h, 0)
  else:
    print(y*w, 0)
import math
import fractions
import collections
import itertools
from functools import reduce
main()

Submission status: Wrong Answer

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

a_1 = (W - x) * H
a_2 = x * H
b_1 = W * (H - y)
b_2 = W * y

if a_1 < a_2:
  a = a_1
else:
  a = a_2
if b_1 < b_2:
  b = b_1
else:
  b = b_2
if a > b:
  print(str(a) + '  0')
elif b > a:
  print(str(b) + '  0')
else:
  print(str(b) + '  1')

Submission status: Wrong Answer

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

A_1 = (W - x) * H
A_2 = x * H
B_1 = W * (H - y)
B_2 = W * y

if A_1 < A_2:
  A = A_1
else:
  A = A_2
if B_1 < B_2:
  B = B_1
else:
  B = B_2
if A < B:
  print(str(A) + '  0')
elif B < A:
  print(str(B) + '  0')
else:
  print(str(B) + '  1')

Submission status: Wrong Answer

Solution code:
import math
import collections
from operator import mul
from functools import reduce

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

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

print("{0:.6f}".format(float(W*H/2)),flag)

Submission status: Wrong Answer

Solution code:
import math
import collections
from operator import mul
from functools import reduce

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

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

print((W*H)/2,flag)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
if (x,y) == (W//2,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())
print(W*H/2, end=' ')
print(1 if (x==W//2 and y==H//2) else 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == 0:
    if y == 0:
        print("{} {}".format(W*H/2, f))
    elif y == H:
        print("{} {}".format(W*H/2, f))
    else:
        print("{} {}".format(min(y, H-y)*W, f))

elif y/x == H/W or y == -(H/W)*x + H:
    print("{} {}".format(W*H/2, f))

else:
    print("{} {}".format(max(min(x, W-x)*H, min(y, H-y)*W), f))

Submission status: Wrong Answer

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

if x == 0:
    if y == 0:
        print("{} {}".format(W*H/2, f))
    if y == H:
        print("{} {}".format(W*H/2, f))
    else:
        print("{} {}".format(min(y, H-y)*W, f))

elif y/x == H/W or y == -(H/W)*x + H:
    print("{} {}".format(W*H/2, f))

else:
    print("{} {}".format(max(min(x, W-x)*H, min(y, H-y)*W), f))