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:
# coding: utf-8
w, h, x, y = list(map(int, input().split()))
sv = min(x, w - x) * h
sh = w * min(y, h - y)
f = 1 if sv == sh else 0
print("{} {}".format(max(sv, sh), f))

Submission status: Wrong Answer

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


if x == y and x == (W/2):
    print('{} 1'.format(0.5*W*H))
else:
    print('{} 0'.format(0.5*W*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:
# coding: utf-8
# Your code here!

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

sizes = []
sizes.append([x * H, (W - x) * H])
sizes.append([W * y, (W - x) * y])

mins = list(map(min, sizes))
if abs(W / 2 - float(x)) < 1e-9 and abs(H / 2 - float(y)) < 1e-9:
    print(max(mins), 1)
else:
    print(max(mins), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res2 = int((W/2 == x) and (H/2 == y))

tate1 = (W - x) * H
tate2 = x * H 
tate = min(tate1, tate2)

yoko1 = W * (H - y)
yoko2 = W * y
yoko = min(yoko1, yoko2)

res1 = max(yoko, tate)

print(res1, res2)

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import defaultdict
from functools import reduce

# s = input()
# n = int(input())
# A = list(map(int, input().split()))
W, H, x, y = map(int, input().split())

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

print(W*H/2, res)

Submission status: Wrong Answer

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

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

# print(min(x*H, (W-x)*H), min(W*y, (H-y)*W))

if min(x*H, (W-x)*H) == min(W*y, (H-y)*W):
    cnt = 1

print(minseki, cnt)

Submission status: Wrong Answer

Solution code:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
w,h,x,y=IL()
if w%2==0 and h%2==0 and 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())
a = min((w-x)*h, x*h)
b = min((w*(h-y), w*y))
m = 0
if a == b:
    m = 1
if 2*x == w and 2*y == h:
    b = w*h/2
    m = 1
print(str(max(a,b)) + " " + str(m))

Submission status: Wrong Answer

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


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

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

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

elif abs(ans1_1 - ans1_2) <  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 0)
    
elif abs(ans1_1 - ans1_2) ==  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 1)
    
else:
    print(min(ans2_1, ans2_2), 0)

Submission status: Wrong Answer

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

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)

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

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

if s1 == s2:
  print(str(s1) + " 1")
elif s1 > s2:
  print(str(s1) + " 0")
else:
  print(str(s2) + " 0")

Submission status: Wrong Answer

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

multi = False

M = 0
if x < W and y < H:
    A = (W-x) * H
    B = W * (H - y)
    M = max(A, B)
    if A == B:
        multi = True
else:
    M = W * H / 2

print M, 1 if multi else 0

Submission status: Wrong Answer

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

yoko_menseki_min = min(W*(H-y),W*y)
tate_menseki_min = min((W-x)*H,x*H)

if yoko_menseki_min == tate_menseki_min:
    result = 1
else:
    result = 0

print(max(yoko_menseki_min,tate_menseki_min),result)

Submission status: Wrong Answer

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

res2 = int((W/2 == x) and (H/2 == y))

res1 = 0

tate1 = (W - x) * H
tate2 = x * H 
tate = min(tate1, tate2)

yoko1 = W * (H - y)
yoko2 = W * y
yoko = min(yoko1, yoko2)

res = max(yoko, tate)

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
w, h, x, y = map(int, input().split())
a = []
b = []
if x > 0: a.append(h * x)
if x < w: a.append(h * (w - x))
if y > 0: b.append(w * y)
if y < h: b.append(w * (h - y))
ans = max(min(a), min(b))
print(ans, 0 + (min(a) == min(b)))

Submission status: Wrong Answer

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

print(W*H/2)
if 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())

s=float(w*h/2)
if s==0:
    ans=1
elif w//2==x and h//2==y:
    ans=1
else:
    ans=0

print(str(s)+" "+str(ans))

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
l=[W*y,W*(H-y),H*(W-x),H*x]
print(min(l),int(l.count(min(l))>1))

Submission status: Wrong Answer

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

print((H * W) // 2, end=" ")

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

Submission status: Wrong Answer

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

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

a = w * (h-y)
b = w * y

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

ab = min(a, b)
cd = min(c, d)

if ab == cd:
    print(ab, 1)
else:
    print(max(ab, cd), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！

w,h,x,y=map(int,input().split())
p,q=min(h*x,h*(w-x)),min(y*w,(h-y)*w)
if p==q:
    if h//2==y or w//2==x:
        print(p,1)
    else:
        print(p,0)
else:
    if p>q:
        if h//2==y:
            print(p,1)
        else:
            print(p,0)
    else:
        if w//2==x:
            print(q,1)
        else:
            print(q,0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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:
# -*- coding: utf-8 -*-
W,H,x,y = [int(i) for i in input().split(" ")]
if W == H:
    double_ans = 1
else:
    double_ans = 0


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())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

s= int(W/2*H)

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

print(s,a)

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 or (x-c_w)/(y-c_h) == -W/H or (x-c_w)/(y-c_h) == W/H:
        way = 0
    print("{} {}".format(W*H/2, way))
main()

Submission status: Wrong Answer

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

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

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

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

print(max(s,t),result)

Submission status: Wrong Answer

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

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

# 横
men1 = w * y
men2 = w * (h-y)

# 縦
men3 = x * h
men4 = (w-x) * h


#print("{0} {1} {2} {3}".format(str(men1), str(men2), str(men3), str(men4)))
out1 = max(min(men1, men2), min(men3, men4))
if min(men1, men2) == min(men3, men4):
    out2 = 1
elif w == h:
    out2 = 1
else:
    out2 = 0

print("{0} {1}".format(out1, out2))

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
l=[W*y,W*(H-y),H*(W-x),H*x]
print(min(l),l.count(min(l))>1)

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

Submission status: Wrong Answer

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

multi = False

rx = x
lx = W - x
uy = y
by = H - y

mx = min([rx*H,lx*H])
my = min([W*uy,W*by])
m = max(mx,my)

print(float(m), int(mx == my))

Submission status: Wrong Answer

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

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

if s1 == s2:
  print(str(s1) + " 1")
elif s1 > s2:
  print(str(s1) + " 0")
else:
  print(str(s2) + " 0")

Submission status: Wrong Answer

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


if (W+1) / 2 == x:
    if (H+1) / 2 == y:
        ans = 1
    else:
        ans = 0
elif (H+1) / 2 == y:
    ans = 0
else:
    ans = 1

print(str(W*H/2) + " " + str(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = W * H / 2

ans_s = 0

if(x == W//2 and y == H //2):
	ans_s = 1

print(ans,ans_s)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
w,h,x,y=map(int,input().split())
num=0
if w==h:
    num=1
else:
    num=0
print("{} {}".format(w*h/2,num))

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 == H) or (x == 0 and y == H) or (x == W and y == 0):
    print((W*H)/2, 0)
elif abs(W/2-x) > abs(H/2-y):
    A = W*y
    B = W*(H-y)
    print(min(A,B), 0)
elif abs(H/2-y) > abs(W/2-x):
    A = H*x
    B = H*(W-x)
    print(min(A,B), 0)
else:
    print((W*H)/2, 1)

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

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

Submission status: Wrong Answer

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

s=float(w*h/2)

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

print(str(s)+" "+str(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, raw_input().split())
S =(float)(W*H/2)
t = 0
if(W/2 == x and W%2 == 0 and H%2 == 0 and H/2 ==y):
	t = 1
ans = str(S)+" "+str(t)
print(ans)

Submission status: Wrong Answer

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

multi = False
if x == W/2 and y == H/2:
    multi = True

M = 0
if x < W and y < H:
    A = (W-x) * H
    B = W * (H - y)
    M = max(A, B)
else:
    M = W * H / 2

print M, 1 if multi else 0

Submission status: Wrong Answer

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！

w,h,x,y=map(int,input().split())
p,q=min(h*x,h*(w-x)),min(y*w,(h-y)*w)
if p==q:
    print(p,1)
else:
    if p>q:
        if h//2==y:
            print(p,1)
        else:
            print(p,0)
    else:
        if w//2==x:
            print(q,1)
        else:
            print(q,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 ans[0] == ans[1]:
    print(str(max(ans)) + ' 1')
else:
    print(str(max(ans)) + ' 0')

Submission status: Wrong Answer

Solution code:
W, H, x, y = list(map(int, input().split()))
area = [x*H,(W-x)*H,y*W,(H-y)*W]
if area[0]==area[1] or area[0]==area[2] or area[0]==area[3] or area[1]==area[2] or area[1]==area[3] or area[2]==area[3]:
    print(min(area), 1)
else:
    print(min(area), 0)

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(1))
else:
    print(str(w * h / 2) + " " + str(0))

Submission status: Wrong Answer

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

s1 = w * y
s2 = w * (h - y)

s3 = h * x
s4 = h * (w - x)

sy = float(min(s1, s2))
sx = float(min(s3, s4))


if sx > sy:
    print(sx, 0)
elif sy > sx:
    print(sy, 0)
else:
    print(sx, 1)

Submission status: Wrong Answer

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


x=abs(x-W/2)
y=abs(y-H/2)
W=W/2
H=H/2


kouho1=(W-x)*H*2
kouho2=(H-y)*W*2

print(max(kouho1,kouho2),end=" ")
if kouho1==kouho2:
    print("1")
elif kouho1>kouho2 and y==0:
    print("1")
elif kouho1<kouho2 and x==0:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

Solution code:

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

SQR = W*H

H_SQR = SQR/2

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

Submission status: Wrong Answer

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


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

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

if abs(ans1_1 - ans1_2) <  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 0)
    
elif abs(ans1_1 - ans1_2) ==  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 1)
    
else:
    print(min(ans2_1, ans2_2), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
num=0
if N[2]*2==N[0] & N[3]*2==N[1]:
    num=1
print(N[0]*N[1]/2," ",0)

Submission status: Wrong Answer

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

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

print(float(max(s1,s2)), int(s1==s2))

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
m=W*H-min(W*y,W*(H-y),x*H,(W-x)*H)
ans=0
if 2*x==W:
  ans=1
if 2*y==H:
  ans=1
print(str(m)+" "+str(ans))

Submission status: Wrong Answer

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

area_horizontal = min(w*y, w*(h-y))
area_vertical = min(h*x, h*(w-x))

multiple = 0

if area_vertical == area_horizontal:
    multiple += 1

print(min(area_vertical, area_horizontal), multiple)

Submission status: Wrong Answer

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

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

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  w,h,x,y=LI()

  a1=x*h
  b1=(w-x)*h

  a2=y*w
  b2=(h-y)*w

  m1=m2=inf
  if a1<=b1:
    m1=a1
  else:
    m1=b1

  if a2<=b2:
    m2=a2
  else:
    m2=b2

  if m1==m2:
    print(m1,1)
  else:
    if m1<=m2:
      print(m2,0)
    else:
      print(m1,0)

main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
w, h, x, y = map(int, input().split())
a = [h * x, h * (w - x)]
b = [w * y, w * (h - y)]
ans = max(min(a), min(b))
print(ans, 0 + (min(a) == min(b)))

Submission status: Wrong Answer

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

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

ans2 = int(W / 2 == x and H / 2 == y)
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
num=0
if N[2]*2==N[0] & N[3]*2==N[1]:
    num=1
print(N[0]*N[1]/2," ",1)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int,input().split())
print(W * H / 2, 0 if W // 2 != X or H // 2 != Y else 1)

Submission status: Wrong Answer

Solution code:
W , H , x , y = map(int,input().split())
if x == 0 or x == W:
	x_on_line = True
else:
	x_on_line = False
if y == 0 or y == H:
	y_on_line = True
else:
	y_on_line = False

if x_on_line and y_on_line:
	S = 0
	pattern = 1
elif x_on_line or y_on_line:
	S = 0
	pattern = 0
else:
	if (W / 2) == float(x):
		x_half_point = True
	else:
		x_half_point = False
	if (H / 2) == float(y):
		y_half_point = True
	else:
		y_half_point = False
	x_min = min(x,W - x)
	y_min = min(y,H - y)
	S = max((x_min * H),(y_min * W))
	if S == x_min * H:
		if y_half_point:
			pattern = 1
		else:
			pattern = 0
	else:
		if x_half_point:
			pattern = 1
		else:
			pattern = 0
			
print(S,pattern)

Submission status: Wrong Answer

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

wa = min(x * H, (W-x) * H)
sa = min(W * y, W * (H-y))

is_multi = 1 if wa == sa else 0

print(str(max(wa, sa)) + " " + str(is_multi))

Submission status: Wrong Answer

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

S = W*H
vertical_S = min(W*y, S-W*y)
horizontal_S = min(x*H, S-x*H)
ans1 = max(vertical_S, horizontal_S)
ans2 = 0
if vertical_S == horizontal_S or (2*x == W or 2*y == H):
    ans2 = 1
print(ans1, ans2)

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

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

Submission status: Wrong Answer

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

# 横
men1 = w * y
men2 = w * (h-y)

# 縦
men3 = x * h
men4 = (w-x) * h


#print("{0} {1} {2} {3}".format(str(men1), str(men2), str(men3), str(men4)))
out1 = max(min(men1, men2), min(men3, men4))
if min(men1, men2) == min(men3, men4):
    out2 = 1
else:
    out2 = 0

print("{0} {1}".format(out1, out2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mi = lambda: map(int, input().split())

W, H, x, y = mi()

if x == W/2 and y == H/2:
  print('%d 1' % (W*H/2))
else:
  print('%d 0' % (W*H/2))

Submission status: Wrong Answer

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

s = w * h / 2
flag = 1 if x == w // 2 and y == h // 2 else 0

print(s, flag)

Submission status: Wrong Answer

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

a = W * H / 2
b = 0
if W % 2 == 0 and H % 2 == 0: b =1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#横
sq1 = W * y
sq2 = sq - sq1

mini = abs(sq1 - sq2)

#縦
sq3 = H * x
sq4 = sq - sq3

mini2 = abs(sq3 - sq4)

met = 0
if mini == mini2:
    met = 1
    print(min(sq1, sq2), met)
elif mini > mini2:
    print(min(sq3, sq4), met)
else:
    print(min(sq1, sq2), met)

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:
    ans1 = min(x * H, (W - x) * H)
    ans2 = min(W * y, W * (H - y))
    if ans1 == ans2:
        print(ans1, 1)
    else:
        print(max(ans1, ans2), 0)

Submission status: Wrong Answer

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

def checkx(W, H, y):
    a = W*y
    b = W*(H-y)
    return min(a,b)

def checky(W, H, x):
    a = H*x
    b = H*(W-x)
    return min(a,b)

a = checkx(W,H,y)
b = checky(W,H,x)
if a == b:
    print(max(a,b), 1)
else:
    print(max(a,b), 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 sys
sys.setrecursionlimit(10 ** 7)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def main():
    W, H, x, y = LI()
    Sx = min(x, W-x)*H
    Sy = min(y, H-y)*W
    print(max(Sx, Sy), int(Sx == Sy))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


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


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(W, H, x, y):
    if W/2 == x and H/2 == y:
        return (W*H)/2, 1

    return max(min((W-x) * H, x*H), min(W * (H-y), W*y)), 0


def main():
    W, H, x, y = read_int_n()
    print('%f %d' % slv(W, H, x, y))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

S1 = min(y, H - y) * W
S2 = min(x, W - x) * H

if S1 == S2:
    print(S1, 1)
else:
    print(S1 if S1 > S2 else S2, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
flg=0
if w//2==x: flg+=1
if h//2==y: flg+=1
print(str(w*h/2)+" "+str(1-flg%2))

Submission status: Wrong Answer

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

yoko_a = W * y
yoko_b = W * (H-y)
yoko = min(yoko_a, yoko_b)

tate_a = H * x
tate_b = H * (W-x)
tate = min(tate_a, tate_b)

ans = max(tate, yoko)
ans = float(ans)

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

print(ans, ans_2)

Submission status: Wrong Answer

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

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

ans2 = int(W % 2 == x and H % 2 == y)
print(ans1, ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x1, x2 = x, W - x
y1, y2 = y, H - y

S = W * H / 2
flag = (x1 == x2) or (y1 == y2)
v = 1 if flag else 0

print('{} {}'.format(S, v))

Submission status: Wrong Answer

Solution code:
def inpl():
    return list(map(int, input().split()))


W, H, x, y = inpl()

if 2 * x == H and 2 * y == W:
    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())

D=[0]

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 = min(x*h,(w-x)*h)
b = min(y*w,(h-y)*h)
if a == b:
    print(a,1)
else:
    print(min(a,b),0)

Submission status: Wrong Answer

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

s = 0.5 * w * h
has_multi = 0

if 2 * x == w and 2 * y == h:
    has_multi = 1
elif (2 * x == w or 2 * y == h):
    has_multi = 0
else:
    has_multi = 1

print(s, has_multi)

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('{:.6f}'.format(s),1)
else:
    print('{:.6f}'.format(s),0)

Submission status: Wrong Answer

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

m = min(H*x,H*(W-x))
n = min(W*y,W*(H-y))
c = 0
if m==n:
	c=1
a = float(max(n,m))

print(a,c)

Submission status: Wrong Answer

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

M=W*H

mW=min(x,W-x)
mH=min(y,H-y)

if H*mW==W*mH:
    print(M*mW/W,1)
elif (mW/W)>(mH/H):
    print(M*mW/W,0)
else:
    print(M*mH/H,0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


x=abs(x-W/2)
y=abs(y-H/2)
W=W/2
H=H/2


kouho1=(W-x)*H*2
kouho2=(H-y)*W*2

print(max(kouho1,kouho2),end=" ")
if kouho1==kouho2:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	w,h,x,y = map(int, io().split())
	s=w*h/2
	dd= 1 if (w//2==x and h//2 == y) else 0
	print(str(s) + ' ' + str(dd))
	#return ss, dd

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	main(io)
	#print (main(io))

Submission status: Wrong Answer

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

# 縦分割
vertical = min(W-x, x)*H

#横分割
horizontal = min(H-y, y)*W

print('{} {}'.format(max(vertical, horizontal) ,int(vertical == horizontal)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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