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

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:
    someFlg = 0

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
if H > W:
    W,H = H,W
    x,y = y,x
x = min(W-x,x)
y = min(H-y,y)
ans = 1
if W*y == H*x:
    ans = 0
if 2*x == W and 2*y == H:
    ans = 1
print('{} {}'.format(W*H/2,ans))

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
#l=[int(i) for i in input().split()]
a=[y*w,(h-y)*w]
a.sort()
b=[x*h,(w-x)*h]
b.sort()
d=[a[0],b[0]]
d.sort()
#print(a,b,d)
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 d[0]==d[1]:
    print(d[1],1)
else:
    print(d[1],0)

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 == H and x == y)
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split(" "))
s = w * h
a = []

a.append(min(x * h,s - x * h))
a.append(min(w * y,s - w * y))

if a.count(max(a)) > 1:
    print('{:.6f}'.format(max(a)),1)
else:
    print('{:.6f}'.format(max(a)),0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

import fractions

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

print(W * H / 2, c)

Submission status: Wrong Answer

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

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

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

out = 0
flag = False
if yoko > tate:
  out = yoko
elif tate > yoko:
  out = tate
elif tate == yoko:
  out = tate
  flag = True
  
if flag:
  print(out, '1')
elif not flag:
  print(out, '0')

Submission status: Wrong Answer

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

box_s = H*W
min_x = min(box_s*(x/W),box_s*((W-x)/W))
min_y = min(box_s*(y/H),box_s*((H-y)/H))
print(max(min_x,min_y))
if x==y or min_x==min_y:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
if (w-x)*h==w*(h-y):
    print('{:6f}'.format((w-x)*h),1)
elif (w-x)*h>w*(h-y):
    print('{:6f}'.format((w-x)*h),0)
else:
    print('{:6f}'.format(w*(h-y)),0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(float, input().split())
ansx = min([(W-x)*H,x*H])
ansy = min([(H-y)*W,y*W])
if ansx == ansy == 0:
    print(ansx,0)

elif 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)
    ans = min(xleft, xright, ydown, yup)
    count = 0
    if ans == xleft: count += 1
    if ans == xright: count += 1
    if ans == ydown: count += 1
    if ans == yup: count += 1
    if count == 1:print(ans, 0)
    else: print(ans, 1)
    return

if __name__ == "__main__":
    solve()

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.0
	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().split())

xs = [x, W - x, W]
ys = [y, H - y, H]

rects_x = [_x for _x in [W * (H-y), W * y] if _x != 0]
rects_y = [_y for _y in [H * (W-x), H * x] if _y != 0]

print(max(min(rects_x), min(rects_y)), 0 if min(rects_x) != min(rects_y) else 1)

Submission status: Wrong Answer

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

print(minseki, cnt)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
X=min(W-x,x)
S1=X*H
Y=min(H-y,y)
S2=Y*W
if S1==S2:
  print(S1,1)
elif S1>S2:
  print(S1,0)
else:
  print(S2,0)

Submission status: Wrong Answer

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

ls.append(H * (W - x))
ls.append(W * (H - y))
a = 0
if W == H:
    a = 1
print(max(ls),a)

Submission status: Wrong Answer

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

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

if x == 0 or x == W or y == 0 or y == H: print(sq0, 0)
elif sq1 == sq2: print(sq1, 1)
elif sq1 > sq2: print(sq1, 0)
elif sq1 < sq2: print(sq2, 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:
        if x == y:
            multi_split = "1"
        area = float(W) * y
    print("{:.6f} {}".format(area, multi_split))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
H,W,a,b = map(int, input().split())

if W == 2 * a and H == 2 * b:
    print((W * H) / 2 ,1)

else:
    print((W * H) / 2 ,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:
    l.append(1)
else:
    l.append(0)
for i in l:
    print(i,end=" ")

Submission status: Wrong Answer

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

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

# Case "|"
lsq = h * x
rsq = h * (w - x)
wk1 = min(lsq, rsq)

# Case "-"
usq = y * w
dsq = (h - y) * w
wk2 = min(usq, dsq)

# Case Equal
if wk1 == wk2:
    ans2 = 1
else:
    ans2 = 0

ans1 = max(wk1, wk2)

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

# Output
print(ans1, ans2)

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

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

Submission status: Wrong Answer

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

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

print(a,c)

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

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 = [int(i) for i in input().split()] 

x_u = W-x
x_d = x

x_pat = [x_u*H, x_d*H]

y_u = H-y
y_d = H-y

y_pat = [y_u*W, y_u*W]

if min(x_pat)>min(y_pat):
    area = float(min(x_pat))
else:
    area = float(min(y_pat))
    
if min(x_pat)==min(y_pat):
    num = 1
else:
    num = 0
    
print(area, num)

Submission status: Wrong Answer

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

menseki = float(W * H * 0.5)

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

elif x == W and (y == 0 or y == H):
    flag = 1

elif y == H and (x == 0 or x == H):
    flag = 1

print(menseki,flag)

Submission status: Wrong Answer

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

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 = list(map(int,input().split()))
#横にラインを引く

if y >= H/2:
    yokomax = W * (H-y)
else:
    yokomax = W * (y)
if x >= W/2:
    tatemax = H * (W-x)
else:
    tatemax = H * x
if yokomax == tatemax: 
    print(float(max(yokomax,tatemax)),'1')
else:
    print(float(max(yokomax,tatemax)),'0')

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)
else:
    A = W*y
    B = W*(H-y)
    C = H*x
    D = H*(W-x)
    dup = 0
    if min(A,B) == min(C,D):
        dup = 1
    print(max(min(A,B), min(C,D)), dup)

Submission status: Wrong Answer

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

def solve(W,H,x,y):
  if ((x == W and y == H) or 
      (x == 0 and y == 0) or 
      (x == 0 and y == H) or 
      (x == W and y == 0)):
    return (W * H / 2, 0)
  
  s1 = min(x, W - x) * H
  s2 = min(y, H - y) * W

  if s1 == s2:
    return (s1,1)
  elif s1 > s2:
    return (s1,0)
  else:
    return (s2,0)
  
print(" ".join(map(str,solve(W,H,x,y))))

Submission status: Wrong Answer

Solution code:
w,h,x,y=raw_input().split()
w,h,x,y=int(w),int(h),int(x),int(y)
a_h=w*(h-y)
b_h=w*y
a_v=h*(w-x)
b_v=h*x
if (b_h==a_h and a_v==b_v):
    print b_h*1.000000,1
else :
    m=min(a_h,b_h)
    n=min(a_v,b_v)
    print max(m,n)*1.000000,0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


ans = '{:.9f} {}'.format(w*h/2., 1 if w//2 == x and h //2 == y else 0 )
print( ans )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc130/tasks/abc130_c
import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

def main():
    W, H, x, y = map(int, input().split())
    area = W * H
    if x == W // 2 and y == H // 2:  # 中点
        print('{} {}'.format(area // 2, 1))
    else:
        print('{} {}'.format(area // 2, 0))
        # center_x = W / 2
        # center_y = H / 2
        # if x == center_x or y == center_y:
        #     print('{} {}'.format(area // 2), 0)
        # else:
        #     a = (center_x - x) / (center_y - y)
        #     b = y - a * x
        #     if 0 <= b <= H:
        #         area1 = (b + )
        #
        #
        #     else:




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:

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

w = float(W)
h = float(H)

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

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

Submission status: Wrong Answer

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

flag = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(A1,A2)

Submission status: Wrong Answer

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

a = min(x * H, (W - x) * H)
b = min(y * W, (H - y) * W)
ans = max(a, b)
flg = 1 if abs(a - b) < 1e-9 else 0

print(ans, flg)

Submission status: Wrong Answer

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

f = 0
if x <= w/2 and y <= h/2:
    s1 = x*h
    s2 = w*y
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x > w/2 and y <= h/2:
    s1 = (w-x)*h
    s2 = w*y
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x > w/2 and y > h/2:
    s1 = (w-x)*h
    s2 = w*(h-y)
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x <= w/2 and y > h/2:
    s1 = x*h
    s2 = w*(h-y)
    if s1 == s2:
        f=1
    print(max(s1,s2),f)

Submission status: Wrong Answer

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


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

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

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

elif 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 x == 0 or x == W or y == 0 or y == H:
    print(W*H/2, 0)
else:
    dx1 = x - 0
    dx2 = W - x
    dy1 = y - 0
    dy2 = H - y
    if dx1 == dx2 and dy1 == dy2:
        print(W*H/2, 1)
    elif dx1 == dx2 or dy1 == dy2:
        print(W*H/2, 0)
    else:
        print(W*H/2, 1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():
    W, H, X, Y = map(int, input().split())

    area1 = min(X, W - X) * H
    area2 = W * min(Y, H - Y)
    if area1 == area2:
        print(area1, 1)
    else:
        print(max(area1, area2), 0)

input = lambda: stdin.readline()
main()

Submission status: Wrong Answer

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

if x > y:
    H = H - y
elif x < y:
    W = W - x
elif x == y:
    W = W - x
    ans = 1
S = W * H
    
print(S, ans)

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
w, h, x, y = map(int, input().split())
ans = w * h / 2 if 0 < x < w or 0 < y < h else w * h
print(ans, 0 + (x == w / 2 and y == h / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
"""考え方
よくわからんけど、縦か横の直線で分割する？

"""
def solve():
    W, H, x, y = list(map(int, input().split()))

    # 縦に分割する場合
    ans1 = min(x*H, (W-x)*H)

    # 横に分割する場合
    ans2 = min(W*y, W*(H-y))

    ans = max(ans1, ans2)

    if ans1 == ans2:
        is_multi = 1
    else:
        is_multi = 0

    print(ans, is_multi)


if __name__ == "__main__":
    solve()

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

Submission status: Wrong Answer

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

W = int(W)
H = int(H)
x = int(x)
y = int(y)

S = W * H / 2

f = 0
if x == int(W/2) & y == int(H/2):
    f = 1

print(S, f)

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:
		print(2)
		ans2 = 1
	elif abs(W-x) == abs(H-y):
		print(3)
		ans2 = 1
	elif W-x == H-(H-y):
		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())

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

a=max(min(x1,x2),min(y1,y2))
if min(x1,x2)==min(y1,y2):
    b=1
else:
    b=0
    
print(a,b)

Submission status: Wrong Answer

Solution code:
W,H,x,y = 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
	print("%f %d" % (max(S1,S2),0))

Submission status: Wrong Answer

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

ans = w*h/2.0
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())

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

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

r = 1 if a == b else 0
print(float(max(a, b)), r)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
Sy=[w*y,(h-y)*w]
Sx=[x*h,(w-x)*h]
mins=[min(Sx),min(Sy)]
ways=0
if len(set(mins))==1:
  ways=1
else:
  ways=0
print(str(float(max(mins)))+' '+str(ways))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

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

ans1 = min(x * H,(W - x) * H)
ans2 = min(y * W,(H - y) * W)

mx = max(ans1,ans2)

if(ans1 == ans2):
    print(mx,"1")
else:
    print(mx,"0")

Submission status: Wrong Answer

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

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:
def solve():
    W, H, x, y = [int(_) for _ in raw_input().split()]
    ans = W * H / 2.0
    if x == W/2 and y == H/2:
        mul = 1
    else:
        mul = 0
    print ans, mul

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

xs = [x, W - x, W]
ys = [y, H - y, H]

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

# rects = [_x * _y for _x in xs for _y in ys]


print(max(min(rects_x), min(rects_y)), 0 if min(rects_x) != min(rects_y) else 1)

Submission status: Wrong Answer

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

diff_W = min(W - x, x)
diff_H = min(H - y, y)

count = 0

maximum_1 = diff_H * W
maximum_2 = H * diff_W

maximum = max(maximum_1, maximum_2)
if maximum_1 == maximum_2:
    count = 1

print(maximum, count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = 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
    if min(x*H, (W-x)*H) == 0 or min(W*y, (H-y)*W) == 0:
        cnt = 0

print(minseki, cnt)

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 W==x or H==y:
    print(M/2,0)
    exit()
elif (W-x)*H==(H-y)*W:
    print(M/2,0)
    exit()
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())

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

print(max_value, is_mullt_ans)

Submission status: Wrong Answer

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

min_1 = min((w - x) * h, x * h)
min_2 = min((h - y) * w, y * w)

if min_1 == min_2:
    print('{:.6f} {}'.format(min_1, 1))
else:
    print('{:.6f} {}'.format(max(min_1, min_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())
result = 1 if (int(W/2)==x and int(H/2)==y) else 0
print(W*H/2, result)

Submission status: Wrong Answer

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

tmp1 = float((W - x) * H)
tmp2 = float(x * H)
ans1 = min(tmp1, tmp2)

tmp3 = float(W * (H - y))
tmp4 = float(W * y)
ans2 = min(tmp3, tmp4)

ans = max(ans1, ans2)
anscnt = 0
if ans1 == ans2:
    anscnt = 1

print(ans, end=' ')
print(anscnt)

Submission status: Wrong Answer

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

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

x_min = min(x_list)
y_min = min(y_list)

if x_min > y_min:
    print('{:.6f} {}'.format(x_min, 0))
elif x_min < y_min:
    print('{:.6f} {}'.format(y_min, 0))
elif x_min == y_min:
    print('{:.6f} {}'.format(y_min, 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

f = 0
if x <= w/2 and y <= h/2:
    s1 = x*h
    s2 = w*y
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x >= w/2 and y <= h/2:
    s1 = (w-x)*h
    s2 = w*y
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x >= w/2 and y >= h/2:
    s1 = (w-x)*h
    s2 = w*(h-y)
    if s1 == s2:
        f=1
    print(max(s1,s2),f)
elif x <= w/2 and y >= h/2:
    s1 = x*h
    s2 = w*(h-y)
    if s1 == s2:
        f=1
    print(max(s1,s2),f)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
W, H, x, y = map(int, input().split())
f = "0"
if W != x and H != y and x == y and W != 0:
    f="1"
print(str(W*H/2) + " " + f)

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

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)