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(float, input().split())
f = 0
if W / 2 == x and H / 2 == y:
    f = 1

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

c = 0

s = w*h/2

if int(w/2) == x and int(h/2) == y:
    c = 1

print(s,c)

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
W,H,x,y = map(int,input().split())

surface = W * H
ans = [0,0]
# x,yが周上なら最大値は半分で他の分け方は無い
if not(0<x<W and 0<y<H):
    ans = [surface/2,0]
# 点が中央の場合
elif x==W/2 and y==H/2:
    ans = [surface/2,1]
# 点が対角線上の場合（中央除く）
# 対角線の判定はW:H=x:y->H*x==W*y or Wy=HW-Hxをx,yが満たす場合
elif H*x==W*y or W*y == H*W-H*x:
    ans = [surface/2,0]
# x,yが内部なら最大値はmax(min(H*x,総面積-H*x),min(W*y,総面積-W*y))
# もし一致するなら分け方複数ある
else:
    xx = min(H*x,surface-H*x)
    yy = min(W*y,surface-W*y)
    ans[0] = max(xx,yy)
    ans[1] = 1 if xx==yy else 0

print(*ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
W,H,x,y = map(int,input().split())

surface = W * H
ans = [0,0]
# x,yが周上なら最大値は半分で他の分け方は無い
if not(0<x<W and 0<y<H):
    ans = [surface/2,0]
# x,yが内部なら最大値はmax(min(H*x,総面積-H*x),min(W*y,総面積-W*y))
# もし一致するなら分け方複数ある
else:
    xx = min(H*x,surface-H*x)
    yy = min(W*y,surface-W*y)
    ans[0] = max(xx,yy)
    ans[1] = 1 if xx==yy else 0

print(*ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Wrong Answer

Solution code:
import sys

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

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

ans2 = S1 == S2

if (x, y) in [(0, 0), (W, 0), (0, H), (W, H)]:
    print(H * W / 2, 0)
    sys.exit()

print(S, int(ans2))

Submission status: Wrong Answer

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

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

ans2 = S1 == S2

print(S, int(ans2))

Submission status: Wrong Answer

Solution code:
import sys
W,H,x,y = map(int,input().split())
if (x,y) == (W/2,H/2):
  print('{} {}'.format(W*H/2,'1'))
  sys.exit(0)
else: #On rectangle
  if (x == 0 or x == W):
    print('{} {}'.format(W*max(y,H-y)*0,5,'0'))
  if (y == 0 or y == H):
    print('{} {}'.format(W*max(x,W-x)*0,5,'0'))
  #else Inside rectangle

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# C
w,h,x,y = map(int, input().split())
area = w*h/2
if x != 0 and y != 0 and x != w and y != h:
    print('{} {}'.format(area, 1))
else:
    print('{} {}'.format(area, 0))

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, H, x, y = list(map(float, sys.stdin.buffer.readline().split()))
    ret = (W * H) / 2
    p = x == W//2 and y == H//2
    print(ret, 1 if p else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, H, x, y = list(map(int, sys.stdin.buffer.readline().split()))
    ret = (W * H) // 2
    p = x == W//2 and y == H//2
    print(ret, 1 if p else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, H, x, y = list(map(int, sys.stdin.buffer.readline().split()))
    P = 0

    if W == x or H == y:
        ret = W * H
    else:
        Py = x * H
        Px = y * W
        ret = max(Py, Px)
        P = 1 if Py == Px else 0

    print(ret, P)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, H, x, y = list(map(int, sys.stdin.buffer.readline().split()))
    P = 0

    Py = (abs(W-x)) * H
    Px = (abs(H-y)) * W
    ret = max(Py, Px)
    P = 1 if Py == Px else 0
    print(ret, P)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve():
    A = list(map(int, input().split()))
    s = A[0] * A[1] / 2
    b = 0
    
    if A[0] // 2 == A[2] and A[1] // 2 == A[3]:
        b = 1
    if A[0] == A[2] and A[1] == A[3] or 0 == A[2] and 0 == A[3] or 0 == A[2] and A[1] == A[3] or A[0] == A[2] and 0 == A[3]:
        b = 0

    ans = [s, b]
    print(*ans)

# print(solve())

# def solve()が@return voidのとき
solve()

Submission status: Wrong Answer

Solution code:
def solve():
    A = list(map(int, input().split()))
    s = A[0] * A[1] / 2
    b = 1 if A[0] // 2 == A[2] and A[1] // 2 == A[3] else 0
    ans = [s, b]
    print(*ans)

# print(solve())

# def solve()が@return voidのとき
solve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if w * y > h * x:
    print(h * x)
    if h / 2 == y:
        print(1)
    else:
        print(0)
elif w * y < h * x:
    print(w * y)
    if w / 2 == x:
        print(1)
    else:
        print(0)
else:
    print(h * x)
    print(1)

Submission status: Wrong Answer

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

if (
    (W // 2 == x and H // 2 == y)
    or (W == x and H == y)
    or (W == x and H == 0)
    or (W == 0 and H == 0)
    or (W == 0 and H == 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())

if (
    (W // 2 == x and H // 2 == y)
    or (W == x and H == y)
    or (W == 0 and H == y)
    or (W == 0 and H == 0)
    or (W == 0 and H == 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())

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())
print(W*H/2, int(not ((W/2==x) and (H/2==y))))

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(float, input().split())
ans=w*h//2
if w/2==x and 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(str(w*h//2)+' '+str(1*(w==2*x and h==2*y)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

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

ans = 0
count = 0
if y == (H/W)*x:
    count += 1
    ans = W*H/2
if y == -(H/W)*x:
    count += 1
    ans = W*H/2
if y == W/2:
    count += 1
    ans = W*H/2
if x == H/2:
    count += 1
    ans = W*H/2

if (0 < ans and 1 < count) or (ans == 0 and 0 < count):
    print(ans, 1)
    sys.exit()
elif 0 < ans and count == 1:
    print(ans, 0)
    sys.exit()

ycut = 0
xcut = 0
if y < H/2:
    ycut = W*y
else:
    ycut = W*(H-y)
if x < W/2:
    xcut = H*x
else:
    xcut = H*(W-x)

print(max(ycut, xcut), 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
q = w*h
# 縦に分割
ans1_1 = h*x
ans1_2 = q - ans1_1
ans1 = ans1_1 if ans1_1 <= ans1_2 else ans1_2

# 横に分割
ans2_1 = w*y
ans2_2 = q - ans2_1
ans2 = ans2_1 if ans2_1 <= ans2_2 else ans2_2

if ans1 == ans2:
    print (ans1,1)
elif ans1 < ans2:
    print (ans2,0)
else:
    print (ans1,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C, D = map(int, input().split())
S = A*B/2
#if A%2==1 and B%2==1:
  #S += 0.5

ans = 0
if C == A//2 and D == B//2:
  ans = 1
print(S,ans)

Submission status: Wrong Answer

Solution code:
A, B, C, D = map(int, input().split())
S = A*B//2
if A%2==1 and B%2==1:
  S += 0.5

ans = 0
if C == A//2 and D == B//2:
  ans = 1
print(S,ans)

Submission status: Wrong Answer

Solution code:
#C - Rectangle Cutting
W,H,x,y = map(int,input().split())
def main(W,H,x,y):
    if W == x or H == y or x==0 or y==0:
        ans1 = W*H
        ans2 = 0
    else:
        tmp1 = min((W-x)*H,x*H)
        tmp2 = min(W*(H-y),W*y)
        ans1 = max(tmp1,tmp2)
        if tmp1 == tmp2:
            ans2 = 1
        else:
            ans2 = 0
    print(ans1,ans2)
main(W,H,x,y)

Submission status: Wrong Answer

Solution code:
#C - Rectangle Cutting
W,H,x,y = map(int,input().split())
def main(W,H,x,y):
    if W == x or H == y:
        ans1 = W*H
        ans2 = 0
    else:         
        tmp1 = min((W-x)*H,x*H)
        tmp2 = min(W*(H-y),W*y)
        ans1 = max(tmp1,tmp2)
        if tmp1 == tmp2:
            ans2 = 1
        else:
            ans2 = 0
    print(ans1,ans2)
main(W,H,x,y)

Submission status: Wrong Answer

Solution code:
#C - Rectangle Cutting
W,H,x,y = map(int,input().split())
def main(W,H,x,y):
    tmp1 = min((W-x)*H,x*H)
    tmp2 = min(W*(H-y),W*y)
    ans1 = max(tmp1,tmp2)
    if W == x or H == y:
        ans2 = 0    
    elif tmp1 == tmp2:
        ans2 = 1
    else:
        ans2 = 0
    print(ans1,ans2)
main(W,H,x,y)

Submission status: Wrong Answer

Solution code:
#C - Rectangle Cutting
W,H,x,y = map(int,input().split())
def main(W,H,x,y):
    tmp1 = min((W-x)*H,x*H)
    tmp2 = min(W*(H-y),W*y)
    ans1 = max(tmp1,tmp2)
    if tmp1 == tmp2:
        ans2 = 1
    else:
        ans2 = 0
    print(ans1,ans2)
main(W,H,x,y)

Submission status: Wrong Answer

Solution code:
#C - Rectangle Cutting
W,H,x,y = map(float,input().split())
def main(W,H,x,y):
    tmp1 = min((W-x)*H,x*H)
    tmp2 = min(W*(H-y),W*y)
    ans1 = max(tmp1,tmp2)
    if tmp1 == tmp2:
        ans2 = 1
    else:
        ans2 = 0
    print(ans1,ans2)
main(W,H,x,y)

Submission status: Wrong Answer

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

area_x = min(x * H, (W -x) * H)
area_y = min(W * y, W * (H - y))

area = max(area_x, area_y)

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

Submission status: Wrong Answer

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

WH = W*H

w = (W-x)*H
h = (H-y)*W

if (WH-w)<w:
    w = (WH-w)
if (WH-h)<h:
    h = (WH-h)

if w>h:
    print("{} ".format(w),end="")
else:
    print("{} ".format(h),end="")

if w==h:
    print("1")
else:
    print("0")

Submission status: Wrong Answer

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

WH = W*H

w = (W-x)*H
h = (H-y)*W

if (WH-w)<w:
    w = (WH-w)
if (WH-h)<h:
    h = (WH-h)

if w>h:
    print("{} ".format(w),end="")
else:
    print("{} ".format(h),end="")
if W==h:
    print("1")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1

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

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

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

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

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1

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

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

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

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

print(ans_are, ans)

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1

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

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

print(ans_are, ans)

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1
if ans_are == are_w:
    if w == 2*x:
        ans = 1
if ans_are == are_h:
    if h == 2*y:
        ans = 1
        
print(ans_are, ans)

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1
if ans_are == 0:
    ans_are = w*h
print(ans_are, ans)

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h or w/h == x/y:
    ans = 1

print(ans_are, ans)

Submission status: Wrong Answer

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1

print(ans_are, ans)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
ans=w*h/2.000000000
a=0
if( ((x==0 or x==w)) or (y==0 or y==h)):
  a=0
else:
  if(((x==w/2) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==h/2))):
    a=0
  else:
   	a=1
if(x==w/2 and y==h/2):a=1
print('{:.6f}'.format(ans),a)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
ans=w*h/2.000000000
a=0
if( ((x==0 or x==w)) or (y==0 or y==h)):
  a=0
else:
  if(((x==w/2) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==h/2))):
    a=0
  else:
   	a=1
if(x==w/2 and y==h/2):a=1
print('{:.7f}'.format(ans),a) #小数点以下3位

Submission status: Wrong Answer

Solution code:

w,h,x,y=map(int,input().split())
ans=w*h/2.000000000
a=0
if( ((x==0 or x==w) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==0 or y==h)) ):
  a=0
else:
  if(((x==w/2) and (0<=y and y<=h)) or ((0<=x and x<=w) and (y==h/2))):
    a=0
  else:
   	a=1
if(x==w/2 and y==h/2):a=1
print('{:.7f}'.format(ans),a) #小数点以下3位

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    WH = W * H
    X = min(H * x, WH - H * x)
    Y = min(W * y, WH - W * y)
    cnt = (1 if X == Y else 0)

    print(min(X, Y), cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

areax = min(x*H, (W-x)*H)
areay = min(W*y, W*(H-y))

ans1 = max(areax, areay)
if areax == areay :
    ans2 = 1
else :
    ans2 = 0

print(ans1, ans2)

Submission status: Wrong Answer

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

if a_area == b_area:
    print(max(a_area,b_area),1)
else:
    print(max(a_area,b_area),0)

Submission status: Wrong Answer

Solution code:

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

print("{0} {1}".format(H * W / 2, int(x + x == W & y + y == H)))

Submission status: Wrong Answer

Solution code:

W, H, x, y = map(int, input().split())
area1 = [x * H, (W - x) * H]
area2 = [W * y, W * (H - y)]
judge = 1
cnt = 0

if min(area1) > min(area2):
    ans = min(area1)
else:
    ans = min(area2)
    judge = 0


for i in range(len(area1)):
    if judge == 1:
        if ans == area2[i]:
            cnt = 1
    else:
        if ans == area1[i]:
            cnt = 1


print("{0} {1}".format(ans,cnt))

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

Submission status: Wrong Answer

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

print(half, p)

Submission status: Wrong Answer

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

print(half, p)

Submission status: Wrong Answer

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

area = W*H // 2
pl = x == W // 2 and y == H // 2
print(area, int(pl))

Submission status: Wrong Answer

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

#長方形の重心を求める
gx = W / 2.0
gy = H / 2.0

# x,yが重心と一致する場合は複数ある
split = 0

print(x,y,gx,gy)
if x == gx and y == gy:
    split = 1

print(W*H/2,split)

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)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W , H , x, y = (map(int , input().split()))
men = W * H
bun = x * H
bunbun = y * W
if bun == bunbun:
    ans2 = 1
else:
    ans2 = 0
ans = men - min(bun , bunbun)
print(float(ans) , ans2)

Submission status: Wrong Answer

Solution code:
import math
def main():
    t = [int(t)for t in input().split()]
    w,h,x,y = t[0],t[1],t[2],t[3]

    left,right = x, w-x
    top, bottom = y, h-y



    s_ = [left*h,right*h,top*w,bottom*w]
    s_ = sorted(s_)

    if s_[3]==0 and s_[0]==s_[1]:
        print(s_[1],0)
    else:
        print(s_[2],1 if s_[2]==s_[3] else 0)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    t = [int(t)for t in input().split()]
    w,h,x,y = t[0],t[1],t[2],t[3]

    left,right = x, w-x
    top, bottom = y, h-y

    s_ = [left*h,right*h,top*w,bottom*w]
    s_ = sorted(s_)
    print(s_[2],1 if s_[2]==s_[3] else 0)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X, H, x, y = map(int, input().split())
S = X * H
max_small = S / 2

print(max_small, end=' ')
if x == y:
    print('1')
else:
    print('0')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

area1 = min(x, w-x) * h
area2 = w * min(y, h-y)
mulch = 1 if area1 == area2 else 0
print(max(area1, area2), mulch)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    print(W * H / 2, 1)


main()

Submission status: Wrong Answer

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

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

    print(W * H / 2, 1)


main()

Submission status: Wrong Answer

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

a=[]
b=[]
judge=0

if x!=W-x:
    a.append(min(x,W-x)*H)
    b.append(max(x,W-x)*H)
else:
    a.append(x*H)
if y!=H-y:
    a.append(min(y,H-y)*W)
    b.append(max(y,H-y)*W)
else:
    a.append(y*W) 

if (max(a) in b) or a[0]==a[1]:
    judge=1


print(max(a),judge)

Submission status: Wrong Answer

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

a=[]
b=[]
judge=0

a.append(min(x,W-x)*H)
a.append(min(y,H-y)*W)
b.append(max(x,W-x)*H)
b.append(max(y,H-y)*W)

if max(a) in a and b:
    judge=1

print(max(a),judge)

Submission status: Wrong Answer

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

a=[]
judge=0

a.append(min(x,W-x)*H)
a.append(min(y,H-y)*W)

if a[0]==a[1]:
    judge=1

print(max(a),judge)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  w, h, x, y = map(int, input().strip().split())
  print((w * h)/2, 1 if w//2 == x and h//2 == y else 0)
  pass

if __name__=='__main__':
  main()

Submission status: Wrong Answer

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

#正方形なら複数　これも面積半分?
#長方形なら一つ 点対称の線を引けば面積半分にできる

if W == H:
    print(W*H/2, 1)
elif 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())

#正方形なら複数　これも面積半分?
#長方形なら一つ 点対称の線を引けば面積半分にできる

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

# 面積の半分
area_half = W * (H / 2)
# 点 x,y が中心なら分割方法は複数
if x == W//2 and y == H//2:
  print(area_half, 1)
else:
  print(area_half, 0)

Submission status: Wrong Answer

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

# 面積の半分
area_half = W * H / 2
# 点 x,y が中心なら分割方法は複数
if x == W//2 and y == H//2:
  print(area_half, 1)
else:
  print(area_half, 0)

Submission status: Wrong Answer

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

if x == int(w/2) and y == int(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 / 2, int(W // 2 == x and H // 2 == y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os, sys, re, math, queue

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

ret = W * H
mul = 0

ret1 = min(H*x, H*(W-x))
ret2 = min(W*y, W*(H-y))

if ret1 != ret2:
	print(max(ret1,ret2), 0)
else:
	print(ret1, 1)

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

(W, H, X, Y) = [int(n) for n in input().split()]

v1 = X * H
v2 = (W - X) * H
vmin = min(v1, v2)

h1 = W * Y
h2 = W * (H - Y)
hmin = min(h1, h2)

if X > Y:
    imin = (Y + (W - X)) * (Y + (W - X)) / 2
else:
    imin = (X + (H - Y)) * (X + (H - Y)) / 2

if (W - X) > Y:
    dmin = (X + Y) * (X + Y) / 2
else:
    dmin = ((W - X) + (H - Y)) * ((W - X) + (H - Y)) / 2

mins = [vmin, hmin, imin, dmin]
min_value = max(mins)
min_count = mins.count(min_value)

print('%f %s' % (min_value, 1 if min_count > 1 else 0))

Submission status: Wrong Answer

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

#外周上
if x == 0 or x == w or y == 0 or y == h:
	ret = str(w * h / 2) + " 0"
	print (ret)

#対角線上
if ret == "":
    xy = sorted([x, y])
    wh = sorted([w, h])
    if xy[0] / xy[1] == wh[0] / wh[1]:
        ret = str(w * h / 2)
        if w / 2 == x and h / 2 == y:
            ret += " 1"
        else:
            ret += " 0"
        print (ret)

if ret == "":
    idx = 0
    ele.append(sorted([(w - x) * h, x * h]))
    ele.append(sorted([(h - y) * w, y * w]))
    rate.append(ele[0][0] / sum(ele[0]))
    rate.append(ele[1][0] / sum(ele[1]))
    if rate[0] < rate[1]:
        idx = 1
    ret = str(ele[idx][0])
    if rate[0] == rate[1]:
        ret += " 1"
    else:
        ret += " 0"
    print (ret)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split(' ')))
hoge = w / 2 == x
fuga = h / 2 == y
print('%.6f %s' % ((w*h) / 2, int(not(hoge ^ fuga))))

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split(' ')))
hoge = w / 2 == x
fuga = h / 2 == y
print('%.8f %s' % ((w*h) / 2, int(not(hoge ^ fuga))))

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split(' ')))
hoge = w / 2 == x
fuga = h / 2 == y
print((w*h) / 2, int(not(hoge ^ fuga)))

Submission status: Wrong Answer

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

if x == 0 or x == w or y == 0 or y == h:
	ret = str(w * h / 2) + " 0"
	print (ret)

if ret == "":
    idx = 0
    ele.append(sorted([(w - x) * h, x * h]))
    ele.append(sorted([(h - y) * w, y * w]))
    rate.append(ele[0][0] / sum(ele[0]))
    rate.append(ele[1][0] / sum(ele[1]))
    if rate[0] < rate[1]:
        idx = 1
    ret = str(ele[idx][0])
    if rate[0] == rate[1]:
        ret += " 1"
    else:
        ret += " 0"
    print (ret)

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

(W, H, X, Y) = [int(n) for n in input().split()]

v1 = X * H
v2 = (W - X) * H
vmin = min(v1, v2)

h1 = W * Y
h2 = W * (H - Y)
hmin = min(h1, h2)

if X > Y:
    imin = (Y + (W - X)) * (Y + (W - X)) / 2
else:
    imin = (X + (H - Y)) * (X + (H - Y)) / 2

if (W - X) > Y:
    dmin = (X + Y) * (X + Y) / 2
else:
    dmin = ((W - X) + (H - Y)) * ((W - X) + (H - Y)) / 2

mins = [vmin, hmin, imin, dmin]
min_value = max(mins)
min_count = mins.count(min_value)

print('%f %s' % (min_value, min_count - 1))

Submission status: Wrong Answer

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

if (x == 0 and y == h) or (x == w and y == 0):
	ret = str(w * h / 2) + " 1"
	print (ret)

if ret == "":
    idx = 0
    ele.append(sorted([(w - x) * h, x * h]))
    ele.append(sorted([(h - y) * w, y * w]))
    rate.append(ele[0][0] / sum(ele[0]))
    rate.append(ele[1][0] / sum(ele[1]))
    if rate[0] < rate[1]:
        idx = 1
    ret = str(ele[idx][0])
    if rate[0] == rate[1]:
        ret += " 1"
    else:
        ret += " 0"
    print (ret)