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

First = min(W * (H - y), W * y)
Second = min(x * H, (W - x) * H)
check = 0
if First == Second:
    check = 1
print(max(First, Second), check)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lx = []
lx.append(x * h)
lx.append((w - x) * h)

ly = []
ly.append(w * y)
ly.append(w * (h - y))

if min(lx) > min(ly):
    flg = 1 if min(lx) in ly else 0
    print(min(lx), flg)
else:
    flg = 1 if min(ly) in lx else 0
    print(min(ly), flg)

Submission status: Wrong Answer

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

a = x * h if x > w / 2 else (w - x) * h
b = w * y if y > h / 2 else (h - y) * w

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

Submission status: Wrong Answer

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

# 大きくない方とかって書いてあるけど、別にイコールの場合でもいいんかい！
# 中心の座標を求める
centerX = (W // 2)
centerY = (H // 2)

if ((x, y) == (centerX, centerY)):
    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())

# 大きくない方とかって書いてあるけど、別にイコールの場合でもいいんかい！
# 中心の座標を求める
centerX = (W // 2)
centerY = (H // 2)

if ((x, y) == (centerX, centerY)):
    menseki = (W * H) / 2
    print(format(menseki, '.10f'), 1)

else:
    print(format(W * H / 2, '.10f'), 0)

Submission status: Wrong Answer

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

# 大きくない方とかって書いてあるけど、別にイコールの場合でもいいんかい！
# 中心の座標を求める
centerX = (W // 2)
centerY = (H // 2)

if ((x, y) == (centerX, centerY)):
    menseki = (W * H) / 2
    print(format(menseki, '.9f'), 1)

else:
    menseki = (W * H) / 2
    print(format(W * H / 2, '.9f'), 0)

Submission status: Wrong Answer

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

# 大きくない方とかって書いてあるけど、別にイコールの場合でもいいんかい！
# 中心の座標を求める
centerX = (W // 2)
centerY = (H // 2)

if ((x, y) == (centerX, centerY)):
    menseki = (W * H) / 2
    print(format(menseki, '.9f'), 1)

else:
    menseki = (W * H) / 2
    print(format(menseki, '.9f'), 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)
    exit()

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

if abs(x-W/2) < abs(y-H/2):
    ans = min(x, W-x) * H
else:
    ans = W * min(y,H-y)

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, 1)
    exit()

if abs(x-W/2) < abs(y-H/2):
    ans = min(x, W-x) * H
else:
    ans = W * min(y,H-y)

print(ans, 0)

Submission status: Wrong Answer

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

a=min(x*H,(W-x)*H)
b=min(y*W,(H-y)*W)
ans=0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,X,Y=map(int,input().split())

ans2=0
if ((W%2==0)*W//2==X)*(X>0) and ((H%2==0)*H//2==Y)*(Y>0):
    ans2=1

ans1=max(min(X*H,(W-X)*H),min(W*Y,W*(H-Y)))

print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
W,H,X,Y=map(int,input().split())

ans2=0
if W==H:
    ans2=1

ans1=max(min(X*H,(W-X)*H),min(W*Y,W*(H-Y)))

print(ans1,ans2)

Submission status: Wrong Answer

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

if(w==0 or h==0):
    print(0,1)
    exit()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    a = abs(W / 2 - x) / W
    b = abs(H / 2 - y) / H

    ans = []
    if a > b:
        ans.append((1 - b) * W)
    else:
        ans.append((1 - a) * H)

    if H * abs(W - 2 * x) == W * abs(H - 2 * y):
        ans.append(1)
    else:
        ans.append(0)

    print(*ans)
    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

area = max(min(w*y, w*(h-y)), min(x*h, (w-x)*h))
is_multi = 0

if x == w//2 and area == min(w*y, w*(h-y)):
    is_multi = 1
elif y == h//2 and area == min(x*h, (w-x)*h):
    is_multi = 1
    
print(area, is_multi)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

area = max(min(w*y, w*(h-y)), min(x*h, (w-x)*h))
is_multi = 0

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

area = max(min(w*y, w*(h-y)), min(x*h, (w-x)*h))
is_multi = 0

if area in [w*y, w*(h-y)] and x == w//2:
    is_multi = 1
elif area in [x*h, (w-x)*h] and y == h//2:
    is_multi = 1
    
print(area, is_multi)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
area = w*h
#複数あるのか判定
if w == h:
    ch = 1
else:
    ch = 0
height = min(x*h,(w-x)*h)
wide = min(y*w,(h-y)*w)
print(max(height,wide),ch)

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

Submission status: Wrong Answer

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

y_min = min(W*y, W*(H-y))
x_min = min(H*x, H*(W-x))

if y_min == x_min:
    ans = 1
else:
    ans = 0
print(max(x_min, y_min), ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if float(W)/2 == x and float(H)/2 == y:
    a.append(1)
elif int(float(H)/W)*x == y:
    a.append(2)
else:
    a.append(0)
print(*a)

Submission status: Wrong Answer

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

d = W * H // 2

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

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
'''input
3 7 1 1
'''
import sys

import numpy as np
from collections import deque
from collections import Counter
from itertools import accumulate
from itertools import permutations, combinations
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt
### ceil切り上げ，floor切り下げ

def main():
	W, H, x, y = map(int, input().split())
	if (W%2 == 0 and H%2 == 0) and \
			(W//2 == x and H//2 == y):
		print(W*H//2, 1)
	else:
		print(W*H//2, 0)


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
def main():
	W, H, x, y = map(int, input().split())
	if (W%2 == 0 and H%2 == 0) and \
			(W//2 == x and H//2 == y):
		print(W*H//2, 1)
	else:
		y_min = min([W*y, W*(H-y)])
		x_min = min([H*x, H*(W-x)])
		minmax = max([y_min, x_min])
		print(minmax, 0)


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

horizontal = [W*(H-y),W*y]
vertical = [(W-x)*H, x*H]

if max(horizontal) > max(vertical):
  print(min(vertical), 0)
elif max(horizontal) < max(vertical):
  print(min(horizontal), 0)
else:
  print(min(min(horizontal),min(vertical)), 1)

Submission status: Wrong Answer

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

horizontal = [W*(H-y),W*y]
vertical = [(W-x)*H, x*H]

if max(horizontal) > max(vertical):
  print(min(vertical), 0)
elif max(horizontal) < max(vertical):
  print(min(horizontal), 0)
else:
  print(min(horizontal), 1)

Submission status: Wrong Answer

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

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:
# 点(x, y)から長方形の中心を通る直線を引くと面積を半分にすることができ、分割された小さい方の面積が最大となる
# 点(x, y)が長方形の中心と一致する場合、直線は複数存在する

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

s = w * h
s_min = s / 2

# 中心
a = w / 2
b = w / 2

divide = 0

if x == a and y == b:
    divide = 1
    print(s_min, divide)
else:
    print(s_min, divide)

Submission status: Wrong Answer

Solution code:
# 点(x, y)からx軸とy軸に垂直に直線を引き、面積を2分割する
# 小さい面積を求めて、x軸に垂直な直線を引いた時かy軸に垂直な直線を引いた時かどちらの方が大きいか比較する
# 頂点では例外処理
w, h, x, y = map(int, input().split())

s = w * h

# x軸に垂直な直線を引く
s_x = x * h
s_x_another = s - s_x
s_x_min = min(s_x, s_x_another)

# y軸に垂直な直線を引く
s_y = w * y
s_y_another = s - s_y
s_y_min = min(s_y, s_y_another)

# 頂点のとき
if x==0 and y==0 or x==w and y==0 or x==0 and y==h or x==w and y==0:
    divide = 0
    print(s/2, divide)
# 頂点以外のときは比較
else:
    if s_x_min == s_y_min:
        divide = 1
        print(s_x_min, divide)
    else:
        divide = 0
        s_min = max(s_x_min, s_y_min)
        print(s_min, divide)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())

if X == 0 and Y == 0:
    print(W*H*0.5,0)
    exit()
if X == W and Y == H:
    print(W*H*0.5,0)
    exit()
if X == 0 and Y == H:
    print(W*H*0.5,0)
    exit()
if X == W and Y == 0:
    print(W*H*0.5,0)
    exit()
C = min(X/W,(1-X/W))
D = min(Y/H,(1-Y/H))

if C == D:
    print(W*H*C,1)
else:
    print(max((C*W*H),(D*W*H)),0)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())

if X == 0 and Y == 0:
    print(W*H*0.5,0)
    exit()
if X == W and Y == H:
    print(W*H*0.5,0)
    exit()

C = min(X/W,(1-X/W))
D = min(Y/H,(1-Y/H))

if C == D:
    print(W*H*C,1)
else:
    print(max((C*W*H),(D*W*H)),0)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())

if X == 0 and Y == 0:
    print(W*H*0.5,0)
    exit()

C = W*H*(min(X/W, (1-X/W)))
D = W*H*(min(Y/H, (1-Y/H)))
if C == D:
    print(C,1)
else:
    print(min(C,D), 0)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())

if X == 0 and Y == 0:
    print(W*H*0.5,0)
    exit()

C = W*H*(X/W)
D = W*H*(Y/H)
if C == D:
    print(C,1)
else:
    print(min(C,D), 0)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())
C = X/W
D = Y/H
result2 = 0
result = 0
if C == 0 and D == 0:
    result = W*H*0.5
elif C == 0:
    result = D*W*H
elif D == 0:
    result = C*W*H
else:
    result = min(C,D)*W*H

if X != 0 and Y != 0:
    if X == Y:
        result2 = 1

print(result,result2)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int, input().split())
C = X/W
D = Y/H
if C == 0:
    print(D*W*H)
elif D == 0:
    print(C*W*H)
else:
    print(min(C,D)*W*H)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
# a = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
# k = int(input())
#L = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
#ab = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))
print(w*h/2, end=" ")
if x == w/2 and y == w/2:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split()))
# a = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(n)]
# k = int(input())
#L = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
#ab = [list(map(int, input().split())) for i in range(n)]
# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))
if w == h and x == w/2 and y == w/2:
    print(w*h/2, end=" ")
    print(1)
else:
    print(max(min(w*(h-y), w*y), min(h*(w-x), h*x)), end=" ")
    print(0)

Submission status: Wrong Answer

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()
INF = 10 ** 9 + 7


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

    area1 = -1
    if not(x == 0 or x == W):
        width = min(x, W - x)
        area1 = width * H

    area2 = -2
    if not(y == 0 or y == H):
        height = min(y, H - y)
        area2 = height * W

    ans = max(area1, area2)
    res = 1 if area1 == area2 else 0
    print(ans, res)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()
INF = 10 ** 9 + 7


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

    area1 = INF
    if not(x == 0 or x == W):
        width = min(x, W - x)
        area1 = width * H

    area2 = INF + 1
    if not(y == 0 or y == H):
        height = min(y, H - y)
        area2 = height * W

    ans = max(area1, area2)
    res = 1 if area1 == area2 else 0
    print(ans, res)


if __name__ == '__main__':
    solve()

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=map(int,input().split())

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

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:
import fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline

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

def divide_list(l, args):
    result = []
    pre = 0
    for i, a in enumerate(args):
        if i != 0:
            pre = args[i-1]
        result.append(l[pre:a])
        if i == len(args) - 1:
            result.append(l[a:])
    return result

def divide_two(n):
    c = 0
    while True:
        if c >= 2:
            break
        if n % 2 != 0:
            break
        n //= 2
        c += 1
    return c

def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import fractions
import sys
from functools import reduce
import math

input = sys.stdin.readline

def main():
    w, h, x, y = input_list()
    hw = w//2
    hh = h//2
    if hw == x and hh == y:
        print(hw*h, 1)
        exit()
    if hw == x:
        print(hw*h, 0)
        exit()
    if hh == y:
        print(hh*w, 0)

def divide_list(l, args):
    result = []
    pre = 0
    for i, a in enumerate(args):
        if i != 0:
            pre = args[i-1]
        result.append(l[pre:a])
        if i == len(args) - 1:
            result.append(l[a:])
    return result

def divide_two(n):
    c = 0
    while True:
        if c >= 2:
            break
        if n % 2 != 0:
            break
        n //= 2
        c += 1
    return c

def get_camulative(l):
    import itertools
    # 累積和
    return [0] + list(itertools.accumulate(l))

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


def gcd(*numbers):
    return reduce(fractions.gcd, numbers)


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

t = (w*h)/2

a = x*h
b = (w-x)*h

abmin = min(a,b,t)

c = y * w
d = (h-y) * w

cdmin = min(c, d,t)

ans = max(abmin, cdmin)

judge = 0
lis1 = sorted([a,b])
lis2 = sorted([c,d])

if lis1 == lis2:
    judge = 1

if ans == t:
    judge = 0

print(ans, judge)

Submission status: Wrong Answer

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

t = (w*h)/2

a = x*h
b = (w-x)*h

abmin = min(a,b)

c = y * w
d = (h-y) * w

cdmin = min(c, d)

ans = max(abmin, cdmin,t)

judge = 0
lis1 = sorted([a,b])
lis2 = sorted([c,d])

if lis1 == lis2:
    judge = 1

if ans == t:
    judge = 0

print(ans, judge)

Submission status: Wrong Answer

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

a = x*h
b = (w-x)*h

abmin = min(a,b)

c = y * w
d = (h-y) * w

cdmin = min(c, d)

ans = max(abmin, cdmin)

judge = 0
lis1 = sorted([a,b])
lis2 = sorted([c,d])

if lis1 == lis2:
    judge = 1


print(ans, judge)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
if w/2 == x and h/2 == y:
    ans = (w * h) / 2
    print(str(ans) + ' 1')
else:
    X = min(x, w-x)
    ans = X * h
    print(str(ans) + ' 0')

Submission status: Wrong Answer

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

print(S, can)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=min(x*h,h*w-x*h)
b=min(y*w,h*w-y*w)

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=min(x*h,h*w-x*h)
b=min(y*w,h*w-y*w)

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=min(x*h,h*w-x*h)
b=min(y*w,h*w-y*w)

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

Submission status: Wrong Answer

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

print(ma,boo)

Submission status: Wrong Answer

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

print(ma,boo)

Submission status: Wrong Answer

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

print(ma,boo)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())[:-1]
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [list(input())[:-1] for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]

w,h,x,y=map(int,input().split())
ma=w*h/2
H=h/2
W=w/2
if H==x and W==y:
    boo=1
else:
    boo=0

print(ma,boo)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
flag=0
if w%2==0 or h%2==0:
  if x == w //2 and y == h // 2:
    flag = 1
s=0
for i in range(h):
  s += w
print(s/2,flag)

Submission status: Wrong Answer

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

if x == W*0.5 and y == H*0.5:
    print(H*W*0.5, 1)
elif y == (H/W) * x or y == -(H/W) * x + H:
    print(H*W*0.5, 0)
elif x == W*0.5 or y == H*0.5:
    print(H*W*0.5, 0)
else:
    s1 = max(x, W-x) * H
    s2 = max(y, H-y) * W
    print(max(s1, s2), 0)

Submission status: Wrong Answer

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

if x == W*0.5 and y == H*0.5:
    print(H*W*0.5, 1)
elif y == (H/W) * x or y == -(H/W) * x:
    print(H*W*0.5, 0)
elif x == W*0.5 or y == H*0.5:
    print(H*W*0.5, 0)
else:
    s1 = max(x, W-x) * H
    s2 = max(y, H-y) * W
    print(max(s1, s2), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
a = w - x if w - x <= x else x
b = h - y if h - y <= y else y

ans = a * h if a * h >= b * w else b * w
if a * h == b * w:
    print(ans, 1)
else:
    print(ans, 0)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
W, H, x, y = map(int, input().split())
Wi = W * 10 ** 9
Hi = H * 10 ** 9
men = Decimal(W * H / 2)
judge = 0
if x == W // 2 and y == H // 2:
  judge = 1
print("{0:.10f} {1:.0f}".format(men, judge))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
Wi = W * 10 ** 9
Hi = H * 10 ** 9
men = W * H / 2
judge = 0
if x == W // 2 and y == H // 2:
  judge = 1
print("{0:.9f} {1:.0f}".format(men, judge))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
men = round(W * H / 2)
judge = 0
if x == W // 2 and y == H // 2:
  judge = 1
print("{} {}".format(men, judge))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

area = (w*h/2)
c = 0

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

if (x == 0) or (x == w) or (y == 0) or (y == h):
    c = 0

print(area,c)

Submission status: Wrong Answer

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

area = (w*h/2)
c = 0

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

print(area,c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

area = W*H/2
center_x = W//2
center_y = H//2

if center_x == x and center_y == y:
    print(area, 1)
else:
    print(area, 0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
#必ず半分にできる…とはいえるのか？多分いえる。
#長方形の重心を通るようにひけばok.
ans = w*h/2
if x*2==w or y*2==h:
	print(ans, 1)
else:
	print(ans, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
#必ず半分にできる…とはいえるのか？多分いえる。
#長方形の重心を通るようにひけばok.
ans = w*h/2
if w==h:
	print(ans, 1)
else:
	print(ans, 0)

Submission status: Wrong Answer

Solution code:
w,h, x,y = map(int,input().split())
ans = w*h/2
if w%2==0 and h%2==0:
    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())
a = 0
b = 0
a = (w)*(h-y)
b = (w)*y
ans = 0
ans = min(a,b)

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

if ans<ans2:
    print(ans2, 0, sep=" ")
elif ans2<ans:
    print(ans, 0, sep=" ")
else:
    print(ans, 1, sep=" ")

Submission status: Wrong Answer

Solution code:
w,h, x,y = map(int,input().split())
a = 0
b = 0
a = (w)*(h-y)
b = (w)*y
ans = 0
ans = min(a,b)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if W//2 == x and H//2 == y:
    print('{} {}'.format((W*H)/2 ,1))
else:
    print('{} {}'.format((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('{} {}'.format((W*H)/2 ,1))
else:
    print('{} {}'.format((W*H)/2, 1))

Submission status: Wrong Answer

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

dou=0
if w//2==x and h//2==y:
  dou=1

print(w*h/2,dou)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
print(w*h/2,a)

Submission status: Wrong Answer

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

if w==0 or h==0:
    print(0,0)
    sys.exit()

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

Submission status: Wrong Answer

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

if w==0 or h==0:
    print(0,1)
    sys.exit()

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

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
print(w*h/2,a)

Submission status: Wrong Answer

Solution code:
def intMap(): return map(int,input().split())

w,h,x,y = intMap()

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

print("{:.10f} {}".format(s,multi))

Submission status: Wrong Answer

Solution code:
def intMap(): return map(int,input().split())

w,h,x,y = intMap()

s = w * h / 2
multi = 0
if x == w // 2 and y == h // 2:
    multi = 1

print("{:.10f} {}".format(s,multi))