Problem:


Score : 300 points

Problem Statement

There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H).
You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

Print the maximum possible area of the part whose area is not larger than that of the other, followed by 1 if there are multiple ways to cut the rectangle and achieve that maximum, and 0 otherwise.

The area printed will be judged correct when its absolute or relative error is at most 10^{-9}.

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

The line x=1 gives the optimal cut, and no other line does.

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1



Sample input:
2 3 1 2


Sample output:
3.000000 0

Submission status: Wrong Answer

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

flg = 0
s=0

if x<=w/2 and y <= h/2:
    s = max(x*h,w*y)
elif x<=w/2 and y>h/2:
    s = max(x*h,w*(h-y))
elif x>w/2 and y <= h/2:
    s = max( (w-x)*h , w*y)
elif s>w/2 and y > h/2:
    s = max( (w-x)*h, w*(h-y))

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

if w==h and x==y:
    flg ==1
    
print(s,flg)

Submission status: Wrong Answer

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

flg = 0
s=0

if x<=w/2 and y <= h/2:
    s = max(x*h,w*y)
elif x<=w/2 and y>h/2:
    s = max(x*h,w*(h-y))
elif x>w/2 and y <= h/2:
    s = max( (w-x)*h , w*y)
else:
    s = max( (w-x)*h, w*(h-y))

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

print(s,flg)

Submission status: Wrong Answer

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

if w != h:

    num_split = 0

    if  x > y:

        maxarea_small = w * y

    else:
        
        maxarea_small = h * x

else:

    if  x > y:
        num_split = 0
        maxarea_small = w * y

    elif x < y:
        num_split = 0
        maxarea_small = h * x

    else:
        num_split = 1
        maxarea_small = x * h


print(maxarea_small, num_split)

Submission status: Wrong Answer

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

S = W*H//2

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

Submission status: Wrong Answer

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

tate = H
if 2*x >= W:
    tate *= W-x
else:
    tate *= x

yoko = W
if 2*y >= H:
    yoko *= H-y
else:
    yoko *= y

if tate == yoko:
    print(tate,1)
else:
    print(max(tate,yoko),0)

Submission status: Wrong Answer

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

scale = w * h


if x > w / 2:
  new_x = w - x
else:
  new_x = x

if y > h / 2:
  new_y = h - y
else:
  new_y = y

x_scale = float(new_x * h)
y_scale = float(new_y * w)

if x_scale == y_scale:
  print('{0:.9f} 1'.format(x_scale))
else:
  print('{0:.9f} 0'.format(max(x_scale, y_scale)))

Submission status: Wrong Answer

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

scale = w * h


if x > w / 2:
  new_x = w - x
else:
  new_x = x

if y > h / 2:
  new_y = h - y
else:
  new_y = y

x_scale = float(new_x * h)
y_scale = float(new_y * w)

if x_scale == y_scale:
  print('{0:.9f} 1'.format(x_scale))
else:
  print('{0:.9f} 0'.format(max(x_scale, y_scale)))

Submission status: Wrong Answer

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

# xで分割
left = x * H
right = (W - x) * H
min_x = min(left, right)

# yで分割
down = W * y
up = W * (H - y)
min_y = min(down, up)

print(max(min_x, min_y), int(min_x==min_y))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float, input().split())
c_w,c_h,other = W/2,H/2,0

if c_h==y and c_w==x:
  other = 1
  print('%f %d'%(W*H/2,other))
  
elif c_h==y or c_w==x:
  if c_w==x: print('%f %d'%(min(W-x, x)*H,other))
  elif c_h==y: print('%f %d'%(min(H-y, y)*W,other))
    
else: 
  other = 1
  print('%f %d'%(W*H/2,other))
 
#長方形を区切る二つの点の座標を求める
'''
else:
  y_ = (c_h-y)/(c_w-x)
  #縦型台形
  if abs(y_*c_w)>=c_h:
    point_ = [[-c_h/y_+c_h,0],[c_h/y_+c_h,c_h*2]]
    S = (point_[0][0]+point_[1][0])*abs((point_[1][1]-point_[0][1]))/2
    print('%f %d'%(S,other))
  elif abs(y_*c_w)<c_h:
    point_ = [[0,-c_w*y_+c_w],[c_w*2,c_w*y_+c_w]]
    S = (point_[0][1]+point_[1][1])*abs((point_[1][0]-point_[0][0]))/2
    print('%f %d'%(S,other))
'''

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float, input().split())
c_w,c_h,other = W/2,H/2,0

if c_h==y and c_w==x:
  other = 1
  print('%f %d'%(W*H/2,other))
  
elif c_h==y or c_w==x:
  if W<H: print('%f %d'%(min(W-x, x)*H,other))
  elif H<W: print('%f %d'%(min(H-y, y)*W,other))
    
else: 
  other = 1
  print('%f %d'%(W*H/2,other))
 
#長方形を区切る二つの点の座標を求める
'''
else:
  y_ = (c_h-y)/(c_w-x)
  #縦型台形
  if abs(y_*c_w)>=c_h:
    point_ = [[-c_h/y_+c_h,0],[c_h/y_+c_h,c_h*2]]
    S = (point_[0][0]+point_[1][0])*abs((point_[1][1]-point_[0][1]))/2
    print('%f %d'%(S,other))
  elif abs(y_*c_w)<c_h:
    point_ = [[0,-c_w*y_+c_w],[c_w*2,c_w*y_+c_w]]
    S = (point_[0][1]+point_[1][1])*abs((point_[1][0]-point_[0][0]))/2
    print('%f %d'%(S,other))
'''

Submission status: Wrong Answer

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

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

s = W*H/2

print(s,flg)

Submission status: Wrong Answer

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

test1=W*min(y,H-y)
test2=H*min(x,W-x)

print(max(test1,test2),1 if x==y==W//2 else 0)

Submission status: Wrong Answer

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

test1=W*min(y,H-y)
test2=H*min(x,W-x)

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
w, h, x, y = map(float, input().split())
ans1 = (w * h) / 2
ans2 = 0
if x == w / 2:
    ans2 = 1
print(ans1, ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

"""
import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）
"""

import sys
readline = sys.stdin.buffer.readline
w,h,x,y=map(int,readline().rstrip().split())

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

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

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

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

else:
    if w*y==h*(w-x):print(max(w*y,h*(w-x)),1)
    else:print(max(w*y,h*(w-x)),0)

Submission status: Wrong Answer

Solution code:

"""
import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）
"""

import sys
readline = sys.stdin.buffer.readline
w,h,x,y=map(int,readline().rstrip().split())

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

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

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

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

else:
    if w*y==h*(w-x):print(max(w*y,h*(w-x)),1)
    else:print(max(w*y,h*(w-x)),0)

Submission status: Wrong Answer

Solution code:

"""
import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）
"""

import sys
readline = sys.stdin.buffer.readline
w,h,x,y=map(int,readline().rstrip().split())

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

Submission status: Wrong Answer

Solution code:
I=lambda:list(map(int,input().split()))
w,r,x,y=I()
an=(w-x)*r
ans=(r-y)*w
if an==ans:
  print(an,1)
else:
  print(max(an,ans),0)

Submission status: Wrong Answer

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

menseki = 0
bunkatsu = 0

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

if h >= w:
    x0 = x
    y0 = 0
else:
    x0 = 0
    y0 = y

menseki = (w - x0) * (h - y0)
print(menseki, bunkatsu)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
area=0
K=0
L=0
if abs(H//2-y)>abs(W//2-x):
    area=H*(min(x,W-x))
    K=x
    L=W
else:
    area=W*min(y,H-y)
    K=y
    L=H

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

# 縦に分ける場合
s1, s2 = x * H, (W - x) * H

# 横に分ける場合
s3, s4 = W * y, W * (H - y)

ans = max(min(s1, s2), min(s3, s4))

if min(s1, s2) == min(s3, s4):
    print(ans,1)
else:
    print(ans,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.0,1)
else:
    print(w*h/2.0,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())

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

s1 = []
s1.append(x*h)
s1.append((w-x)*h)
s2 = []
s2.append(w*y)
s2.append(w*(h-y))
s1.sort()
s2.sort()

if s1[0] > s2[0]:
    print("{} {}".format(s1[0], 0 if s1[0]==s1[1] else 1))
else:
    print("{} {}".format(s2[0], 0 if s2[0]==s2[1] else 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = W * H
sx = min(W-x, x-0) * H
sy = min(H-y, y-0) * W

sMM = max(sx, sy)

same = 0
if sx > sy:
    if sx % W == 0 or W-x != x-0:
        same = 1
if sy > sx:
    if sy % H == 0 or H-y != y-0:
        same = 1
if sx == sy:
    same = 1

print(sMM, same)

Submission status: Wrong Answer

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

S = W * H
sx = min(W-x, x-0) * H
sy = min(H-y, y-0) * W

print(max(sx, sy), int(sx == sy))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def do():
    w,h,x,y=map(int,input().split())
    ar1=(h-y)*w
    ar2=(w-x)*h
    ar=w*h
    if ar1==ar2 and ar/2==ar1:
        return "{} 1".format(ar2)
    elif ar/2==ar1:
        return "{} 0".format(ar1)
    elif ar/2==ar2:
        return "{} 0".format(ar2)
print(do())

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
s1 = min(x, w - x) * h
s2 = min(y, h - y) * w
s = max(s1, s2)
c = 0
if s == s1 and y == h / 2:
    c = 1
elif s == s2 and x == w / 2:
    c = 1
print('{:.6f}'.format(s), c)

Submission status: Wrong Answer

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

if w - x > x:
    s1 = x * h
else:
    s1 = (w - x) * h

if h - y > y:
    s2 = y * w
else:
    s2 = (h - y) * w

if s1 > s2:
    print('{:.6f}'.format(s1), 0)
elif s1 == s2:
    print('{:.6f}'.format(s1), 1)
else:
    print('{:.6f}'.format(s2), 0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(
  max(
    min(H * x, H * (W - x)),
    min(y * W, (H - y) * W)
  ),
  1 if min(H * x, H * (W - x)) == min(y * W, (H - y) * W) else 0
)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
w,h,x,y=map(int,input().split())
if w*y!=h*x:
    print(min(w*y,h*x),0)

else:print(min(w*y,h*x),1)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
w,h,x,y=map(int,input().split())
if w*y!=h*x:
    print(min(w*y,h*x),0)

else:print(min(w*y,h*x),0)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x == w//2 and y == h//2: print(w*h/2, 1)
else:
    if x >= w: a = x * h
    else: a = (w-x) * h
    if y >= h: b = y * w
    else: b = (h-y) * w
    print(max(a,b), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = W * H / 2

print (S, end = ' ')
if W == 2 * x and H == 2 ** y:
    print (1)
else:
    print (0)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
flg = 0
if 2*x==W or 2*y==H:
    flg = 1
res = [W*H/2, flg]
print(*res)

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

if w // 2 == x and h // 2 == y:
    flg = True
else:
    flg = False

S = w * h / 2
    
if flg:
    print(S,1)
else:
    print(S,0)

Submission status: Wrong Answer

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

#たてぶんかつ
a = (w-x)*h
b = (w-(w-x))*h
ans=i=min(a,b)
#よこぶんかつ
c = (h-y)*w
d = (h-(x-y))*w
j = min(c,d)
ans=max(ans,j)

if j==i:
    print(ans,1)
else:
    print(ans,0)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
h_y = abs(y - h/2)
w_x = abs(x - w/2)
yoko = h_y*w
tate = w_x*h
ans = w*h/2 - min(tate, yoko)
flag = 0
if tate == yoko:
    flag = 1
print(ans, flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def myAnswer(W:int,H:int,x:int,y:int) -> None:
   X1 = float((W - x) * (H - 0))
   X2 = float((x - 0) * (H - 0))
   Y1 = float((y - 0) * (W - 0))
   Y2 = float((H - y) * (W - 0))
   split = [X1,X2,Y1,Y2]
   # print(split)
   ans = max(min(X1,X2),min(Y1,Y2))
   if(min(X1,X2) == min(Y1,Y2)):
      print(ans,1)
   else:
      print(ans,0)

def modelAnswer():
   return
def main():
   W,H,x,y = map(int,input().split())
   myAnswer(W,H,x,y)
if __name__ == '__main__':
   main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
area_ans = w * h / 2
cog_x = w/2 
cog_y = h/2
if cog_x == x and cog_y == y:
    cog_ans = 1
    print(str(area_ans) +" "+ str(cog_ans))
elif cog_x == x or cog_y == y:
    cog_ans = 0
    print(str(area_ans) +" "+ str(cog_ans))
else:
    cog_ans = 1
    print(str(area_ans) +" "+ str(cog_ans))

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
area_ans = w * h / 2
cog_x = x/2 
cog_y = y/2
if cog_x == w and cog_y == h:
    cog_ans = 1
    print(str(area_ans) +" "+ str(cog_ans))
elif cog_x == w or cog_y == h:
    cog_ans = 0
    print(str(area_ans) +" "+ str(cog_ans))
else:
    cog_ans = 1
    print(str(area_ans) +" "+ str(cog_ans))

Submission status: Wrong Answer

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

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:
    t = 0
else:
    t = 1

S = W * H / 2
print(S, t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
#b = list(map(int, input().split()))
print((w*h)/2, end=" ")

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

Submission status: Wrong Answer

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

s = [x*h, (w-x)*h]
s2 = [w*y, w*(h-y)]
print(max(min(s), min(s2)), end=" ")

if min(s) == min(s2):
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
#b = list(map(int, input().split()))
s = [x*h, (w-x)*h]
s2 = [w*y, w*(h-y)]
print(max(min(s), min(s2)), end=" ")

if min(s) == min(s2):
    print(0)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
#b = list(map(int, input().split()))
s = [x*h, (w-x)*h]
s2 = [w*y, w*(h-y)]
print(max(min(s), min(s2)), end=" ")

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

Submission status: Wrong Answer

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

X = min(x, W-x) * H
Y = min(y, H-y) * W
ans = 0
if X == Y: ans = 1

if x==0 or x==W: print(Y, 0)
elif y==0 or y==H: print(X, 0)
else: print(max(X,Y), ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int, input().split())
X = max(x, W-x) * H
Y = max(y, H-y) * W
ans = 0
if X == Y: ans = 1
print(max(X, y), ans)

Submission status: Wrong Answer

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/C-RectangleCutting.py
#
w, h, x, y = map(int, input().split())
if x == w or y == h:
    print(0, 0)
    exit()

left = x * h
right = (w - x) * h
up = w * (h - y)
down = w * y
area = left
cutting = 0

if left == right:
    if left == up:
        cutting = 1
elif up == down:
    area = up
elif left < right:
    if up < down:
        if left == up:
            area = left
            cutting = 1
        elif left < up:
            area = left
        else:
            area = up
    else:
        if left == down:
            area = left
            cutting = 1
        elif left < down:
            area = left
        else:
            area = down
else:
    if up < down:
        if right == up:
            area = right
            cutting = 1
        elif right < up:
            area = right
        else:
            area = up
    else:
        if right == down:
            area = right
            cutting = 1
        elif right < down:
            area = right
        else:
            area = down

print(area, cutting)

Submission status: Wrong Answer

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/C-RectangleCutting.py
#
w, h, x, y = map(int, input().split())
if x == w or y == h:
    print(0, 0)
    exit()

left = x * h
right = (w - x) * h
up = w * (h - y)
down = w * y
area = left
cutting = 0

if left == right:
    area = left
elif up == down:
    area = up
elif left < right:
    if up < down:
        if left == up:
            area = left
            cutting = 1
        elif left < up:
            area = left
        else:
            area = up
    else:
        if left == down:
            area = left
            cutting = 1
        elif left < down:
            area = left
        else:
            area = down
else:
    if up < down:
        if right == up:
            area = right
            cutting = 1
        elif right < up:
            area = right
        else:
            area = up
    else:
        if right == down:
            area = right
            cutting = 1
        elif right < down:
            area = right
        else:
            area = down

print(area, cutting)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
size1 = min((x*H), ((W-x)*H))
size2 = min((W*y), (W*(H-y)))
count = 0
if size1 == size2:
  count += 1
print(max(size1, size2), count)

Submission status: Wrong Answer

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

tmp = 0
tmp1 = min((W - x) * H, x * H)
tmp2 = min(W * (H - y), W * y)

if tmp1 == tmp2:
    print(tmp1, 1)
elif tmp1 > tmp2:
    print(tmp1, 0)
else:
    print(tmp2, 0)

Submission status: Wrong Answer

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

calc = w * h / 2
flg = 1
if w/2 == x and h/2 == y:
    flg = 0
print(str(calc) + ' ' + str(flg))

Submission status: Wrong Answer

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

calc = w * h / 2
flg = 1
if x == 0 or x == h or y == 0 or y == w:
    flg = 0
print(str(calc) + ' ' + str(flg))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

W, H, x, y = LI()

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

Submission status: Wrong Answer

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

if x == 0 or x == W or y == 0 or y == H:
    print(area / 2.0, 0)
elif (x == W / 2.0 and y != H / 2.0) or (x != W / 2.0 and y == H / 2.0):
    print(area / 2.0, 0)
elif x == W / 2.0 and y == H / 2.0:
    print(area / 2.0, 1)
elif y / x == H / W or (H - y) / x == H / W:
    print(area / 2.0, 0)
else:
    print(area / 2.0, 1)

Submission status: Wrong Answer

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

if x == 0 or x == W or y == 0 or y == H:
    print(area / 2.0, 0)
elif x == W / 2.0 and y == H / 2.0:
    print(area / 2.0, 1)
elif y / x == H / W or (H - y) / x == H / W:
    print(area / 2.0, 0)
else:
    print(area / 2.0, 1)

Submission status: Wrong Answer

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

if x == 0 or x == W or y == 0 or y == H:
    print(area / 2.0, 0)
elif (x == W / 2.0 and y != H / 2.0) or (x != W / 2.0 and y == H / 2.0):
    print(area / 2.0, 0)
else:
    print(area / 2.0, 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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