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

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

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

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) or
      (x == y)):
    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:
a = input().split()
w = int(a[0])
h = int(a[1])
x = int(a[2])
y = int(a[3])

def main():
    mx = w - x    
    my = h - y
    m1 = mx*h
    m2 = my*w
    m3 = x * h
    m4 = y * w
    minv1 = min([m1,m3])
    minv2 = min([m2,m4])
    res = max((minv2, minv1))
    allc = [m1,m2,m3,m4]
    print(res, )
    if minv2 != minv1:
        res2 = 0
    else:
        res2 = 1
    print(res, res2)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

tate1 = 0
tate2 = 0
yoko1 = 0
yoko2 = 0

tate1 = H*x
tate2 = H*(W-x)
yoko1 = y*W
yoko2 = (H-y)*W

if min(tate1,tate2) < min(yoko1,yoko2):
    print(str(float(min(yoko1,yoko2)))+" "+str(0))
elif min(yoko1,yoko2) <min(tate1,tate2):
    print(str(float(min(tate1,tate2)))+" "+str(0))
else:
    print(str(float(min(tate1,tate2)))+" "+str(1))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
if H==y or H==0:
    xs = min((W-x)*H,(W-(W-x))*H)
    trigle = min((x*H)/2,W*H-x*H/2)
    print(min(xs,trigle))
elif W==x or W==0:
    ys = min((H-y)*W,(H-(H-y))*W)
    trigle = min((y * W) / 2, W * H - y * W / 2)
    print(min(ys,trigle))
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:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

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

flg = 0

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

if w>x and h>y:
    s1 = (w-x)*h
    s2 = (h-y)*w
    s = max(s1,s2)
else:
    s = h*w*0.5

print(s,flg)

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

    if any((X == Y == 0,
            X == W and Y == 0,
            X == W and Y == H,
            X == 0 and Y == H)):
        print(0, 0)
        return

    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:
# 2019 6/16
# ABC130 Rectangle Cutting

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

mid_W = W / 2
mid_H = H / 2

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

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

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

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

    square = max(LR_div, UD_div)

    print(square, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s = W*H
s1 = x*H
s2 = W*y
s3 = min(x+y, H) * min(x+y, W) // 2

s1 = min(s1, s-s1)
s2 = min(s2, s-s2)
s3 = min(s3, s-s3)
sa = max(s1, s2, s3)

ss = set()
ss.add(s1)
ss.add(s2)
ss.add(s3)

a = 1 if len(ss) < 3 else 0
print(sa, a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
S1 = W*H
SA = 0
SB = 0
sp = 0
l = 0
ans = []
if x>(W/2) and y>(H/2):
    SA = (H-y)*W
    SB = (W-x)*H
    l = max(SA,SB)
if x>(W/2) and y<=(H/2):
    SA = y*W
    SB = (W-x)*H
    l = max(SA,SB)
if x<=(W/2) and y>(H/2):
    SA = x*H
    SB = (H-y)*W
    l = max(SA,SB)
if x<=(W/2) and y<=(H/2):
    if x == W/2 and y == H/2:
        sp += 1
        l = x*W
    else:
        SA = x*H
        SB = y*W
        l = max(SA,SB)
ans.append(l)
if sp == 1:
    ans.append(1)
else:
    ans.append(0)
print(ans[0],ans[1])

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:
W, H, x, y = map(int, input().split())
if (x == W and y == H) or (x == 0 or y == 0) or (x == W and y == 0) or (x == 0 and y == H):
    print(W*H, 1)
else:
    # 横分割の時の最小値を求める
    A = min((H-y)*W, y*W)
 
    # 縦分割の時の最小値を求める
    B = min((W-x)*H, x*H)
 
    # 最後に最大の方を選ぶ
    # このときA=Bなら複数あるということ
    if A == B:
        print(A, 1)
    else:
        print(max(A, B), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y=map(int, input().split())
centX=w/2
centY=h/2
if centX-x!=0:
    slope=(centY-y)/(centX-x)
    seppen=centY-slope*centX
    if slope==0:
        print(w*h/2, " ", "0")
    else: print(w*h/2, " ", "1")
elif centX-x==0:
    print(w*h/2, " ", "0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
x = min(W-x,x)
y = min(H-y,y)
ans = 1
if W*y == H*x:
    ans = 0
if 2*x == W or 2*y == H:
    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())

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 yoko == 0 and tate == 0:
  out = W*H

  
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())
S=W*H*0.1/2
z=0
if x== W/2:
    if y== H/2:
        z=1
    else:
        z=0
else:
    z=0
print(S,z)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
S = round(float(W*H/2),10)
if W != H:
  print('{:.10f}'.format(S), 0)
else:
  print('{:.10f}'.format(S),1)

Submission status: Wrong Answer

Solution code:
def solve():
    w, h, x, y = map(float, input().split())
    ans = []
    ans.append(sorted((w * y, w * (h - y)))[0])
    ans.append(sorted((h * x, h * (w - x)))[0])
    print(max(ans), 2 - len(set(ans)))
solve()

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
if float(y) == h - (h/w)*x or float(y) == (h/w) * x:
    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())
menseki = w * h
res1 = 0
tmp = 0
res2 = 0
if menseki % 2 == 0:
    if x * h <= y * w:
        tmp = x
    else:
        tmp = y
# y = h/w*x
if x == h/2 and y == w/2:
    res2 = 1
else:
    res2 = 0
print(menseki/2, res2)

Submission status: Wrong Answer

Solution code:
# coding:utf-8


def main():
    # N = int(input())
    W, H, x, y = map(int, input().split())
    ans = 0
    s1a = (W-x)*H
    s1b = x*H

    s2a = W*(H-y)
    s2b = W*y

    s = max(min(s1a, s1b), min(s2a, s2b))
    if min(s1a, s1b) == min(s2a, s2b):
        ans = 1

    print(float(s), ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def is_center():
    return x * 2 == W and y * 2 == H


def is_on_axis():
    return not is_center() and any([
        x * 2 == W,
        y * 2 == H,
        W * y == -H * x + W * H,
        W * y == H * x,
    ])


if is_center():
    S = W * H / 2
    T = 1
elif is_on_axis():
    S = W * H / 2
    T = 0
else:
    S = max([
        x * (H ** 2) / (H - y) / 2,
        W * (x * y / (W - x) + y) / 2,
    ])
    T = 0

print(str(S) + " " + str(T))

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)

ans = float( max(a, b) )
if x ==  y: num = 1
else: num = 0

print (ans, num)

Submission status: Wrong Answer

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

# xで分割する場合
xres = min((W-x)*H, W*H - (W-x)*y)

# yで分割する場合
yres = min(W*(H-y), W*H - x*(H-y))

check = 1 if xres == yres else 0

print(W*H/2, check)

Submission status: Wrong Answer

Solution code:
from sys import stdin

W, H, x, y = [int(x) for x in stdin.readline().rstrip().split()]
if W == 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())
if x==W:
    if H-y < y:
        y = H-y
    print(y*W, "0")    
elif y==H:
    if W-x < x:
        x = W-x
    print(x*H, "0")
    
else:
    if W-x < x:
        x = W-x
    if H-y < y:
        y = H-y

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

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

print(str("{0:.9f}".format(w*h/2))+' '+result)

Submission status: Wrong Answer

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

a_x = min(x, W - x)
a_y = min(y, H - y)

if (W < H):
    l = H
    m = a_x
else:
    l = W
    m = a_y

ans = l * m

if (x == W/2 and y == H/2):
    multi_ans = 1
elif (W == H):
    multi_ans = 1
else:
    multi_ans = 0

print("{} {}".format(ans, multi_ans))

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:
		if (x1 == 0 or x1 == W) and (y1 == 0 or y1 == H):
			c = 0
		else:
			c = 1
	else:
		c = 0
	
	
	

print(W * H / 2, c)

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(str(max_value) + ' ' + str(is_mullt_ans))

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

Submission status: Wrong Answer

Solution code:
a = input().split()
w = int(a[0])
h = int(a[1])
x = int(a[2])
y = int(a[3])

def main():
    mx = w - x    
    my = h - y
    m1 = mx*h
    m2 = my*w
    m3 = x * h
    m4 = y * w
    minv1 = min([m1,m3])
    minv2 = min([m2,m4])
    res = max((minv2, minv1))
    allc = [m1,m2,m3,m4]
    print(res)
    if minv2 != minv1:
        print(0)
    else:
        print(1)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

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

result = 0

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

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

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


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

Submission status: Wrong Answer

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

a = (w - x) * h
b = x * h
c = (h - y) * w
d = y * w

a1 = 0
a2 = 0
if a > b:   a1 = b
else:       a1 = a
if c > d:   a2 = d
else:       a2 = c
if a1 < a2: a1 = a2

a3 = 0
if w == h and x == y: a3 = 1
print(a1, a3)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, 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:
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)
    if x == (w/2) and y == (h/2) and w == h:
        print(str(sq) + ' ' + '3')
    else:
        print(str(sq) + ' ' + '1')

Submission status: Wrong Answer

Solution code:
WW, HH, XX, YY = input().split()
W = int(WW)
H = int(HH)
X = float(XX)
Y = float(YY)
SV1 = X * H
SV2 = (W - X) * H
SH1 = W * Y
SH2 = W * (H - X)
SV = min([SV1, SV2])
SH = min([SH1, SH2])
S = min(SV, SH)
print(S, 1 if SH == SV else 0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = (int(x) for x in input().split())
max1 = min(x*H, (W-x)*H)
max2 = min(y*W, (H-y)*W)

if max1 == max2:
  flag = 1
else:
  flag = 0
  
print(max(max1,max2), flag)

Submission status: Wrong Answer

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

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

tmp3 = int(W * (H - y))
tmp4 = int(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:
#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from collections import Counter
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


def main():
    W, H, x, y = map(int, input().split())
    split_1 = sorted([x * H, (W - x) * H])
    split_2 = sorted([y * W, (H - y) * W])
    print(float(max(split_1[0], split_2[0])), int(split_1[0] == split_2[0]))


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int, input().split())
x_min = x if x*2<w else w-x
y_min = y if y*2<w else w-y
if x_min>y_min:
    s = x_min*h
    if y/x==h/w:
        ans=1
    else:
        ans=0
elif (x_min==0)&(y_min==0):
    s = w*h/2
    ans=0
elif x_min==0:
    s = y_min*w
    ans=0
else:
    s = y_min*h
    if y/x==h/w:
        ans=1
    else:
        ans=0
print(float(s),ans)

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('{:.18g}'.format(H*W/2), div)

Submission status: Wrong Answer

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

S = W * H

a = x * H
b = S - a
c = y * W
d = S - c

k = max(a, b)
l = max(c, d)

if k < l:
    s = k
else:
    s = l

flag = 0
if a == c or a == d or b == c or b == d:
    flag = 1

print(s * 1.0, flag)

Submission status: Wrong Answer

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

flag = 0

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans_s = float((W*H)/2)
ans_d = 0
if (x == W//2) & (y == H//2):
  ans_d = 1
print("{} {}".format(ans_s, ans_d))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, input().split())
A = min((w - x) * h, x * h)
B = min((h - y) * w, y * w)
print("{0:.06f}".format(max(A, B)), "1" if A == B else "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
        if ans1 == 0:
                ans1 = (W-x)*H
elif (W-x)*H < x*H:
        ans1 = (W-x)*H
        if ans1 == 0:
                ans1 = x*H

if (H-y)*W >= y*W:
        ans2 = y*W
        if ans2 == 0:
                ans2 = (H-y)*W
elif (H-y)*W < y*W:
        ans2 = (H-y)*W
        if ans2 == 0:
                ans2 = 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 = [int(x) for x in input().split()]
if (x == W/2 and y != H/2) or (x != W/2 and y == H/2):
    print('{:.6f}'.format(W*H/2),0)
else:
    print('{:.6f}'.format(W*H/2),1)

Submission status: Wrong Answer

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

gx = 2 / W
gy = 2 / H

is_multi = 1 if (x, y) == (gx, gy) else 0

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

Submission status: Wrong Answer

Solution code:
W,H,x,y= map(int,input().split())
A = H * (W-x)
B = H * x
C = W * (H - y)
D = W * y
E = min(A,B)
F = min(C,D)
if E > F:
    print(E,0)
elif E == F:
    print(E,1)
else:
    print(F,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

W, H, x, y = map(float, 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:
W, H, x, y = map(float, raw_input().split())
x1 = x * H
x2 = (W-x) * H
y1 = y * W
y2 = (H-y) * W
max = max(min(x1, x2),min(y1, y2))
if min(x1, x2) == min(y1, y2):
    print(str(max) + " 1")
else:
    print(str(max) + " 0")

Submission status: Wrong Answer

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

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

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

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
if not s%2==0:
  s = s//2+0.5
else:
  s = s/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 and y==H//2:
    a=1
else:
    a=0
A=str(W*H//2)
if W*H%2==1:
    A+='.5'
print(A,a)

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int,input().split()))
#横にラインを引く
if x ==0 or x == W:
    tatemax = 0
    if y >= H/2:
        yokomax = W * (H-y)
    else:
        yokomax = W * (y)
if y== 0 or y == H:
    yokomax = 0
    if x >= W/2:
        tatemax = H * (W-x)
    else:
        tatemax = H * x

if x !=0 and x != W and y!= 0 and y != H:       
    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 or y==0:
    print("{:.9f}".format(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 = list(map(int, input().split()))

x2 = W-x
y2 = H-y

a = H * x
b = H * x2
c = W * y
d = W * y2

ans = max(min(a,b),min(c,d))

flag = 0

if min(a,b) == min(c,d):
    flag = 1

print(ans,flag)

Submission status: Wrong Answer

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

#たてに分割
left = x*h
right = w*h - left
min1 = min(left,right)

down = y*w
up = w*h - down
min2 = min(down,up)

t = 0
if min1 == min2:
    t = 1
print(max(min1,min2),t)

Submission status: Wrong Answer

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

a_x = min(x, W - x)
a_y = min(y, H - y)

if (W < H):
    l = H
    m = a_x
else:
    l = W
    m = a_y

ans = l * m

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

print("{} {}".format(ans, multi_ans))

Submission status: Wrong Answer

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

# とりうる値
x1 = 0.0
x2 = 0.0
if W - x > x:
    x1 = x * H* 1.0
    x2 = (W-x) * H* 1.0
else:
    x1 = (W-x) * H* 1.0
    x2 = x * H* 1.0

#小さい方の値はx1

y1 = 0.0
y2 = 0.0
if H - y > y:
    y1 = y * W * 1.0
    y2 = (H-y) * W* 1.0
else:
    y1 = (H-y) * W* 1.0
    y2 = y * W* 1.0

if x1 > y1:
    print("{:.6f}".format(x1), end=" ")
else:
    print("{:.6f}".format(y1), end=" ")
if x1 == y1:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
EPS = 1e-9

def main():
    buf = input()
    buflist = buf.split()
    W = int(buflist[0])
    H = int(buflist[1])
    x = int(buflist[2])
    y = int(buflist[3])
    area = []
    multiple = False
    # LR
    area.append(float(min(W * y, W * (H - y))))
    # UD
    area.append(float(min(x * H, (W - x) * H)))
    # diag LD
    if x + y <= H:
        if x + y <= W:
            area.append(min((x + y) * (x + y) / 2, W * H - ((x + y) * (x + y) / 2)))
        else:
            area.append(min(((x + y) + (x + y - W)) * W / 2, W * H - ((x + y) + (x + y - W)) * W / 2))
    else:
        if x + y <= W:
            area.append(min(((x + y - H) + (x + y)) * H / 2, W * H - ((x + y - H) + (x + y)) * H / 2))
        else:
            area.append(min((2 * H - x + y) * (2 * W - x + y) / 2, W * H - ((2 * H - x + y) * (2 * W - x + y) / 2)))
    # diag LU
    W, H, x, y = H, W, y, W - x
    if x + y <= H:
        if x + y <= W:
            area.append(min((x + y) * (x + y) / 2, W * H - ((x + y) * (x + y) / 2)))
        else:
            area.append(min(((x + y) + (x + y - W)) * W / 2, W * H - ((x + y) + (x + y - W)) * W / 2))
    else:
        if x + y <= W:
            area.append(min(((x + y - H) + (x + y)) * H / 2, W * H - ((x + y - H) + (x + y)) * H / 2))
        else:
            area.append(min((2 * H - x + y) * (2 * W - x + y) / 2, W * H - ((2 * H - x + y) * (2 * W - x + y) / 2)))
    area.sort()
    if area[-1] - area[-2] < EPS:
        multiple = True
    print(area[-1], 1 if multiple else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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==a*(b-d) or b*c==b*(a-c):
    l.append(1)
else:
    l.append(0)
for i in l:
    print(i,end=" ")

Submission status: Wrong Answer

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

right_length = W - x
top_length = H -y 

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

S_vertical = H * width
S_horizonal = W * height

flag = 0
if S_vertical == S_horizonal:
    flag = 1

print(max(S_vertical, S_horizonal),flag )

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(str("{0:.6f}".format(w*h/2))+' '+result)

Submission status: Wrong Answer

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

if(2 * x != W) & (2 * y == H):
    S = max(x * H,(W-x) * H)
    z = 0
elif(2 * x == W) & (2 * y != H):
    S = max(y * W, (H-y)*W)
    z = 0
elif(2 * x == W) & (2 * y == H):
    S = H * W * 0.5
    z = 1
else:
    S = ((y - H * 0.5) ** 2)/(x - W * 0.5) + x
    S = S * H
    z = 0

print(S,z)

Submission status: Wrong Answer

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



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

    if(W * y == H * x or y * W ==  -H * x + W * H):
        print float(W)/2.0 * H , ans2
        return

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

if x==0 or x==w:
    print b,0
elif y==0 or y==h:
    print b,0
else:
    if a==b:
        print max(a,b),1
    else:
        print max(a,b),0

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

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

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

min1 = min(candidate1)
min2 = min(candidate2)
max12 = max(min1, min2)

if min1 != min2:
    way = 0
else: way = 1

print(max12, way)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

if (x,y) in [(0,0), (0, h), (w, 0), (w, h)]:
    print(float(w*h), 1)
    exit()

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)