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

right_length = W - x
top_length = H -y 

width = min(W - x,x) 
height = min(H - y, y)

S_vertical = H * width
S_horizonal = W * height

flag = 0
if (x == W/2)&(y == H/2):
    flag = 1
elif W == H:
    flag = 1

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split(" "))
#三角形側が最小値になる
#辺上にあれば半分にできるまた他はない
#というか任意の点に対して長方形なら半分にできる
#中心の点を結んだときに他の線があるか
ans = 0
m2 = W * H
ans = m2 / 2
if W/2 == x or H/2 == y:
    print(ans, 1)
else:
    print(ans, 0)

Submission status: Wrong Answer

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

print(float(W * H / 2), end = ' ')
if x != int(W/2) and y != int(H/2) and W%2==0 and H%2==0:
    print(0)
else:
    print(1)

Submission status: Wrong Answer

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


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


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split())
s = float(w*h/2)
d = 0
if h*x/w == y:
    d = 1
elif -(h*x/w) + h == y:
    d = 1
print("{0} {1}".format(s,d))

Submission status: Wrong Answer

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

res = float((W - x) * H) if (W - x) >= (H - y) else float((H - y) * W)
div_flg = 1 if W == H and x == y else 0

print("{:f} {}".format(res, str(div_flg)))

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: 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:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

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

whalf = False
hhalf = False
if W/2 == x and H/2 == y:
    print(s,1)
elif W/2 == x or H/2 == y:
    print(s,0)
else:
    print(s,1)

Submission status: Wrong Answer

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

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

print(a,c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
[W,H,x,y] = list(map(int,input().split()))
sq = W*H / 2
x_tmp = W/2
y_tmp = H/2
id = 0
if (x - x_tmp) < 10**(-8) and (y - y_tmp) < 10**(-8):
    id = 1
print(Decimal(sq),id)

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

Submission status: Wrong Answer

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

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

num = 0

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

print(area, num)

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(item) for item in input().split()]
S = W * H
if x == 0 or y == 0 or x == W or y == H:
  print (S/2, 0)
else:
  m = max(min(x/W, 1-x/W), min(y/H, 1-y/H))
  ans_s = S * m
  ans_m = 0
  if (x/W == 0.5 and y/H==0.5):
    ans_m = 1
  print (ans_s, ans_m)

Submission status: Wrong Answer

Solution code:
import sys
from math import *
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Wrong Answer

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

max = W*H/2.0

a = W/2
b = H/2

gap = 0.000000001
flag = 0

if(abs(x-1) < gap and abs(y-1) < gap):
    flag = 1

print('{:.6f} {}'.format(max, flag))

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 (x == 0 or x == w) and (y == 0 or y == h):
    b = w*h/2
    m = 0
print(str(max(a,b)) + " " + str(m))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
# 横分割の時の最小値を求める
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:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

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

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

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

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Wrong Answer

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

if W-x < x:
    x = W-x
if H-x < y:
    x = H-x

if x*H > y*W: 
    print(y*W, "0")
elif x*H < y*W:
    print(x*H, "0")
else:
    print(x*H, "1")

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 d[0]==d[1]:
    print(d[1],1)
else:
    print(d[1],0)

Submission status: Wrong Answer

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



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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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:
    if x == 0 or y == 0 or x ==W or y == H:
        result = 0
    else:
        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())
a = (W - x) * H
b = W * (H - y)
if a == b:
    c = 1
else:
    c = 0
print(max(a, b), c)

Submission status: Wrong Answer

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

X = H * x
if X > (W - x) * H:
  X = (W - x) * H

Y = y * W
if Y > W * (H - y):
  Y = W * (H - y)

if X > Y:
  print(X, 0)
elif X < Y:
  print(Y, 0)
elif X == Y:
  print(X, 1)

Submission status: Wrong Answer

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

right_length = W - x
top_length = H -y 

width = min(W - x,x) 
height = min(H - y, y)

S_vertical = H * width
S_horizonal = W * height

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

result = 0

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

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


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

Submission status: Wrong Answer

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

ans = (W * H) / 2
div = 1 if (x == W // 2 and y == H // 2) else 0

print("{0:.9f} {1}".format(ans, div))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if wa == sa:
    is_multi = 1
elif wa > sa:
    if y == H/2:
        is_multi = 1
    else:
        is_multi = 0
elif wa < sa:
    if x == W/2:
        is_multi = 1
    else:
        is_multi = 0

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

Submission status: Wrong Answer

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

a = H * (W-x)
b = W * (H-y)

if a == b:
  print(a, 1)
elif a > b:
  print(a, 0)
else:
  print(b, 0)

Submission status: Wrong Answer

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

diff_W = W - x
diff_H = H - 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:
inf = input().split()
W = int(inf[0])
H = int(inf[1])
x = int(inf[2])
y = int(inf[3])

s = W*H/2
st = "{0:.9f}".format(s)
if W%2==0 and H%2==0:
  gx = W//2
  gy = H//2
  if gx==x and gy==y:
    print(st, 1)
else:
  print(st, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = 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(" ")))

#print(W*H)
if x<y:
    print(x*H,end=" ")
    print(0)
elif x>y:
    print(y*W,end=" ")
    print(0)
else:
    print(x*H,end=" ")
    print(1)

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)
    print(1)
# 対角線上
elif y==H/W*x or y== -H/W*x + H:
    print(AREA/2)
    print(0)
else:
    area_x = H * (min(x, W-x))
    area_y = (min(y,H-y) * W)

    print(max(area_x, area_y), end=' ')
    print(1 if area_x == area_y else 0)

Submission status: Wrong Answer

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

M=W*H

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

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

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())
l = [W * y, W * (H - y), H * (W - x), H * x]
if x == 0 or x == W:
    c = 0 if y != H - y else 1
    ans = W * min(H - y, y) if W * min(H - y, y) != 0 else W * max(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) if H * min(W - x, x) != 0 else H * max(W - x, x)
    print(ans, c)
else:
    v = W * min(H - y, y) if W * min(H - y, y) != 0 else W * max(H - y, y)
    w = H * min(W - x, x) if H * min(W - x, x) != 0 else H * max(W - x, x)
    c = 0 if v != w else 1
    ans = max(v,w)
    print(ans, c)

Submission status: Wrong Answer

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

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:
    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())
area = w * h
verticalCutArea = (h - y) * w
max1 = min(verticalCutArea, area - verticalCutArea)
horizontalCutArea = h * (w - x)
max2 = min(horizontalCutArea, area - horizontalCutArea)
print(max(max1, max2), 1 if max1 == max2 else 0)

Submission status: Wrong Answer

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

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 a == b else 0

print(ans, flg)

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('{0:.6f}'.format(min(sqA,sqB))+ ' ' + "1")
else:
   print('{0:.6f}'.format(min(sqA,sqB))+ ' '  + "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 or dy1 == dy2:
        print(W*H/2, 0)
    else:
        print(W*H/2, 1)

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(item) for item in input().split()]
S = W * H
if x == 0 or y == 0 or x == W or y == H:
  print (1/2, 0)
else:
  m = max(min(x/W, 1-x/W), min(y/H, 1-y/H))
  ans_s = S * m
  ans_m = 0
  if (x/W == 0.5 and y/H==0.5):
    ans_m = 1
  print (ans_s, ans_m)

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

xx=min(a,b)
yy=min(c,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(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 x != 0 and y != 0 and ((x/y == W/H) or (y/x == H/W)):
    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(int,input().split())
O_x = W/2
O_y = H/2
if (float(x) == O_x) ^ (float(y) == O_y):
    print(W*H/2,0)
else:
    print(W*H/2,1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

if (W - x) <= W / 2:
    Rect1 = H * (W - x)
else:
    Rect1 = H * x
    
if (H - y) <= H / 2:
    Rect2 = W * (H - y)
else:
    Rect2 = W * y
    
if Rect1 > Rect2:
    print(Rect1, 0)
elif Rect1 < Rect2:
    print(Rect2, 0)
else:
    print(Rect1, 1)

Submission status: Wrong Answer

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

    d1 = h * min(x, w - x)
    d2 = w * min(y, h - y)

    if d1 == d2:
        print(d1, 1)
    else:
        print(max(d1, d2), 0)


abc()

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(1))
else:
    print(str(w * h / 2) + " " + str(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*((W-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:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
l=[]
x=min(a*d,(b-d)*a)
y=min(b*c,(a-c)*b)
l.append(max(x,y))
if a*d==b*c or d==c*(a/b)+b:
    l.append(1)
else:
    l.append(0)
for i in l:
    print(i,end=" ")

Submission status: Wrong Answer

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

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:
    if x == 0 or y == 0:
        result = 0
    else:
        result = 1
else:
    result = 0

print(max(yoko_menseki_min,tate_menseki_min),result)

Submission status: Wrong Answer

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

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

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

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

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Wrong Answer

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

a = H * (W-x)
b = W * (H-y)

if a == b:
  print(a, 1)
elif a > b:
  print(a, 0)
else:
  print(b, 0)

Submission status: Wrong Answer

Solution code:
W, H , x, y = map(float, input().split())
h = H * x
w = W * y
if h > w:
  print(str(w) + ' 0')
elif h < w:
  print(str(h) +' 0')
else:
  print(str(h) + ' 1')

Submission status: Wrong Answer

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

area = W*H/2

ways = 0
if x == 0 or x == W or y == 0 or y == H or (W/2 == x and H/2 == y):
    ways = 1

print("%.9f" % area, ways)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

res2 = int(yoko == tate)
res1 = max(yoko, tate)

print(res1, res2)

Submission status: Wrong Answer

Solution code:
W, H, x, y = (int(x) for x in input().split())
sx = [x * H, (W - x) * H]
sy = [y * W, (H - y) * W]
sxmin = float(min(sx))
symin = float(min(sy))
if sxmin == symin: print(sxmin, 1)
else: print(max(sxmin, symin), 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:
    print(ansx,1)
else:
    print(max(ansx,ansy),0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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



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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
w,h,x,y = map(int,input().split())
def modify(a):
    if a > 0.5:
        a = 1 - a
    return a
r_x = x/w
r_x = modify(r_x)
r_y = y/h
r_y = modify(r_y)

#print (r_x,r_y)
r = max(r_x,r_y)
#print (r)
flag = str(int(r_x==r_y))
print (str(h*w*r)+" "+flag)

Submission status: Wrong Answer

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

mina = min(w * h - x * h, x * h)
minb = min(w * h - w * y, w * y)

if mina == minb:
    print(float(mina), 1)
else:
    print(float(max(mina, minb)), 0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
if H==y:
    xs = min((W-x)*H,(W-(W-x))*H)
    print(xs)
elif W==x:
    ys = min((H-y)*W,(H-(H-y))*W)
    print(ys)
else:
    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(int, input().split())

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

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)

    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
[W,H,x,y] = list(map(int,input().split()))
sq = W*H / 2
x_tmp = W/2
y_tmp = H/2
id = 0
if (x - x_tmp) < 10**(-8) and (y - y_tmp) < 10**(-8):
    id = 1
print(sq,id)

Submission status: Wrong Answer

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

w,h,x,y = m()

k = h/w * x

if k == y:
    print("{0} {1}".format(w*h/2,1))
else:
    print("{0} {1}".format(w*h/2,0))

Submission status: Wrong Answer

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

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

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

result = 0

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

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

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

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

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

    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 = 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) and y == int(H/2):
    f = 1

print(S, f)

Submission status: Wrong Answer

Solution code:


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

s1 = y*w
s2 = (h-y)*w
s3 = x*h
s4 = (w-x)*h
min12 = min(s1,s2)
min34 = min(s3,s4)

if min12 == min34:
    print(min12, 1)
else:
    print(max(min12,min34), 0)

Submission status: Wrong Answer

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

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

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:
n, m, x, y = map(int, input().split())
print(n * m / 2, bool(x == n / 2 and y == n / 2))

Submission status: Wrong Answer

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

# y = (a - w / 2)(X - a) + b
if a == w / 2:
    ans = w * h / 2
elif b == h / 2:
    ans = w * h / 2
elif a - w / 2 >= w / h or a - w / 2 >= -1 * (w / h):
    key = (h + a * a - w / 2 * a - b) / (a - w / 2)
    ans = key * (w - key) * h / 2
else:
    key = -a * a + w / 2 * a + b
    ans = key * ( h - key) * w / 2
ans2 = 0
if a == w / 2 and b == h / 2:
    ans2 = 1
print(ans, ans2)

Submission status: Wrong Answer

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

a = h*min(w-x,x)
b = w*min(h-y,y)
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())

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

if sq1 == sq2: print(sq1, 1)
elif sq1 > sq2: print(sq1, 0)
elif sq1 < sq2: print(sq2, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(item) for item in input().split()]
S = W * H
if x == 0 or y == 0:
  print (1/2, 0)
else:
  m = max(min(x/W, 1-x/W), min(y/H, 1-y/H))
  ans_s = S * m
  ans_m = 0
  if (x/W == 0.5 and y/H==0.5):
    ans_m = 1
  print (ans_s, ans_m)

Submission status: Wrong Answer

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

ans = max(min(temp1),min(temp2))
if min(temp1) == min(temp2):
    print(ans,1)
else:
    print(ans,0)

Submission status: Wrong Answer

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

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

print(ans)

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)

# Output
print(ans1, ans2)