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: Accepted

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

Submission status: Accepted

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

#x,yが図形の半分の位置かどうか
if x == W/2 and y == H/2:
  menseki = W*H/2
  print(menseki,1)
else:
  menseki = W*H/2
  print(menseki,0)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

print(ans1, ans2)

Submission status: Accepted

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: Accepted

Solution code:
if __name__ == "__main__":
    w, h, x, y = map(int, input().split())
    if x == w / 2 and y == h / 2:
        hukusuu = 1
    else:
        hukusuu = 0

    print(w * h / 2, hukusuu)

Submission status: Accepted

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

if W == x * 2 and H == y * 2:
    half = 1
else:
    half = 0

print(menseki, half)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#c.py
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: Accepted

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

Submission status: Accepted

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

x_test = False
y_test = False

if W%2 == 0 and W//2 == x:
    x_test = True
if H%2 == 0 and H//2 == y:
    y_test = True

if x_test and y_test:
    print(W*H/2,1)
elif x_test or y_test:
    print(W*H/2,0)

elif x*H%W == 0:
    print(W*H/2,0)

elif x == H or y == H:
    x_cent = x > W/2
    y_cent = y > H/2
    s1 = max((H-y)*W, (W-x)*H)
    s2 = max((H-y)*W, x*H)
    s3 = max(y*W, x*H)
    s4 = max(y*W, (W-x)*H)
    if x_cent and y_cent:
        print(s1,0)
    elif y_cent:
        print(s2,0)
    elif x_cent:
        print(s3,0)
    else:
        print(s4,0)   

else:
    x_cent = x > W/2
    y_cent = y > H/2
    s1 = max((H-y)*W, (W-x)*H)
    s2 = max((H-y)*W, x*H)
    s3 = max(y*W, x*H)
    s4 = max(y*W, (W-x)*H)
    if x_cent and y_cent:
        print(s1,1)
    elif y_cent:
        print(s2,1)
    elif x_cent:
        print(s3,1)
    else:
        print(s4,1)

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

if w<h:
    tmp1=w
    tmp2=x
    w=h
    h=tmp1
    x=y
    y=tmp2
if x>w/2:
    x=w-x
if y>h/2:
    y=h-y
a=x*h
b=w*y

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

Submission status: Accepted

Solution code:
import sys

list = list(map(int, input().split()))

W = list[0]
H = list[1]
x = list[2]
y = list[3]

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

Submission status: Accepted

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

g = (W/2, H/2)
S = float(W*H)/2.
if (x, y) != g :
    print(str(S) + " " + str(0))
else :
    print(str(S) + " " + str(1))

Submission status: Accepted

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

if (W == 2 * X) and (H == 2 * Y):
    ans = H * W * 0.5
    z = 1
else:
    ans = H * W * 0.5
    z = 0

print(ans, z)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
w, h, x, y = map(int, input().split())
# output
m = w*h/2
f = 0
if x == w/2 and y == h/2:
    f = 1
print(m, f)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    W, H, x, y = map(int, input().split())
    xleft, xright = x * H, (W - x) * H
    ydown, yup = W * y, W * (H -y)
    if x == W / 2 and y == H / 2: print(W * H /2, 1)
    else: print(W * H / 2, 0)
    return

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,H,x,y=[int(i) for i in input().split(" ")]


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


print(W*H*2,end=" ")

if x==0 and y==0:
    print("1")
else:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
W, H, x, y = map(float, raw_input().split())
m = W * H / 2

if W / 2 == x and H / 2 == y:
    print(str(m) + " 1")
else:
    print(str(m) + " 0")

Submission status: Accepted

Solution code:
W,H,x,y = (int(i) for i in input().split())

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

print("{} {}".format(H*W/2,is_double))

Submission status: Accepted

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

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

    x_c = W/2
    y_c = H/2

    S = W*H/2

    if x == x_c and y == y_c:
        print("{} {}".format(S, 1))
    elif x == x_c or y == y_c:
        print("{} {}".format(S, 0))
    else:
        print("{} {}".format(S, 0))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
W,H,x,y = map(int,input().split())
w = W/2
h = H/2
ansA = 0
ansB = 0

xR = W-x
yR = H-y


ansA = W*H/2

if w == x and h == y:
    ansB = 1

print(ansA,ansB)

Submission status: Accepted

Solution code:
import decimal
w,h,x,y = list(map(int, input().split()))
print("{0:.9f}".format((w*h)/2),int((w/2) == x and (h /2) == y))

Submission status: Accepted

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

# 水平 or 垂直
if x==W/2 and y==H/2:
    print(AREA/2,1)
# 辺の上
else:
    print(AREA/2,0)

Submission status: Accepted

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

ax = W-x
ay = H-y

ok = 0
if ax == x and ay == y:
    ok = 1
print(W*H/2.0, ok)

Submission status: Accepted

Solution code:
#coding:utf-8

a = list(map(int,input().split()))
w = a[0]
h = a[1]
x = a[2]
y = a[3]

s = w*h

print(s/2,end='')

if min(x/w,1-x/w)==0.5 and min(y/h, 1-y/h)==0.5:
    print(" 1")
else:
    print(" 0")

Submission status: Accepted

Solution code:
# できるだけ等しく分割して、その結果の少ないほうの最大値

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

maxsize = w*h

size = float(maxsize) / 2 

if (x == w/2) and (y == h/2):
    answer = str(float(size)) + " 1"
else:
    answer = str(float(size)) + " 0"

print(answer)

Submission status: Accepted

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

if (H%2==0)and (W%2==0)and (x==int(W/2)) and (y==int(H/2)):
    j=1

print(float(S/2),j)

Submission status: Accepted

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

print(ans0, ans1)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(s,f)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 2019 6/16
# ABC130 Rectangle Cutting

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

mid_W = W / 2
mid_H = H / 2

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

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

else:
    # L = H * x
    # R = H * (W - x)
    # LR_div = min(L, R)
    #
    # U = W * (H - y)
    # D = W * y
    # UD_div = min(U, D)
    #
    # square = max(LR_div, UD_div)

    print(H * W / 2, 0)

Submission status: Accepted

Solution code:
def main():
    W, H, x, y = [int(n) for n in input().split()]
    if x == W / 2 and y == H / 2:
        print("%f %d"%(W * H / 2, 1))
    else:
        print("%f %d"%(W * H / 2, 0))
main()

Submission status: Accepted

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

menseki = W * H / 2
answer = 0
if x == (W/2):
  if y == (H/2):
    answer = 1
print(str(menseki) + " " + str(answer))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

W, H, x, y = [int(x) for x in stdin.readline().rstrip().split()]
if W / 2 == x and H / 2 == y:
    print((W * H) / 2, 1)
else:
    print((W * H) / 2, 0)

Submission status: Accepted

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

area = W*H/2
div = 0
if x * 2 == W and y * 2 == H:
    div = 1
print(str(area)+' '+str(div))

Submission status: Accepted

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

'''
2 4 1 2
'''
if W % 2 == 0 and H % 2 == 0:
    if W / 2 == x and H / 2 == y:
        print(W * H / 2,1)
        exit(0)
print(W * H / 2,0)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
w,h,x,y = map(int,input().split())
s = [0] *2
s[0]=(w*h / 2)

if x == w/2 and y == h/2:
    s[1] = 1
else:
    s[1] = 0

print(s[0],s[1])

Submission status: Accepted

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

if W - 2*x == 0:
    if H - 2*y == 0:
        high = H/2
    else:
        high = 0
else:
    high = (H*W - W*y - H*x) / (W - 2*x)     # 縦に2分割する時の、Wのy座標

if H - 2*y == 0:
    if W - 2*x == 0:
        width = W/2
    else:
        width = 0
else:
    width =  (H*W - W*y - H*x) / (H - 2*y)   # 横に2分割する時の、Hのx座標

if (high > 0 and high < H) and (width > 0 and width < W):
    ans = 1
else:
    ans = 0
    
print(W*H/2, ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

decimal.getcontext().prec = 9

(W, H, x, y) = map(decimal.Decimal, input().split(' '))

half = (W * H) / 2

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

print("{} {}".format(half, has_multi))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
W, H, x, y = map(int, input().split())
k = 0
S = W*H/2
if (x == (W/2)) and (y == (H/2)):
  k += 1
print("{} {}".format(S, k))

Submission status: Accepted

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


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

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

    print(h*w/2, num)

Submission status: Accepted

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

half= (W*H)/2
anotherAns= '0'
if(W/2==x and H/2 == y):
  anotherAns= '1'
halfStr= "{0:.6f}".format(half)

print(halfStr+" "+anotherAns)

Submission status: Accepted

Solution code:


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

print('{:.10f}'.format(0.5*W*H),end=' ')
if(x*2 == W and y*2==H):
	print(1)
else:
	print(0)

Submission status: Accepted

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

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

Submission status: Accepted

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: Accepted

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

area = w*h/2

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

#D
def D():
    n, k = LI()
    a = LI()
    dp = [0] * (n)
    for i in range(n):
        dp[i] += dp[i - 1] + a[i]
    ans = 0
    dp.insert(0, 0)
    #print(dp)
    for i in range(1,n+1):
        ai = bisect_left(dp, k + dp[i-1])
        ans += n+1 - ai
        #print(ai, i, k + dp[i-1])
    print(ans)

    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,H,x,y = map(int, input().split())
ans = []
ss = False
w_s = W / (10 ** 5)
up = 0
do = W
for i in range(10 ** 5):
    up += w_s
    do -= w_s
    ans.append((up + do) * H * 0.5)

ans.sort()


if x == W/2 and y == H/2:
    print(str(ans[0]) + " " + "1")
else:
    print(str(ans[0]) + " " + "0")

Submission status: Accepted

Solution code:
import numpy as np

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

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

print(W*H/2,flag)

Submission status: Accepted

Solution code:
##!/usr/bin/env python3
import sys
from operator import itemgetter
# gcd
# from fractions import gcd
# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
# from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# 提出時はコメントアウト+上のshebangを有効にする
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == '__main__':

    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int

    # write code
    if W == 2 * x and H == 2 * y:
        ls = 1
    else:
        ls = 0
    print(W*H/2,ls)

Submission status: Accepted

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

center_x = W/2
center_y = H/2

dx = center_x - x
dy = center_y - y

if dx == 0:
    ans = H*W/2
else:
    slope = dy/dx
    inter = center_y - center_x*slope

    if inter >= 0:
        ay = inter
        by = slope*W + inter
        s_0 = (by + ay)*W/2
        s_1 = H*W - s_0
        ans = min(s_0, s_1)
    else:
        ax = - inter/slope
        bx = (H-inter)/slope
        s_0 = (ax + bx)*H/2
        s_1 = H*W - s_0
        ans = min(s_0, s_1)
print(ans)
if dx == 0 and dy == 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの整数の入力
#a = [int(x) for x in input().split()]
W, H, x, y = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
#p, q, r = map(int, input().split())
#l = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
#print(l, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re

def doit():
  res = [0, 0]
  res[0] = W * H / 2
  if W / 2 == x and H / 2 == y:
    res[1] = 1
  else:
    res[1] = 0
  return res

#print(doit([0] * 4))
#doit(s)
try:
  res = doit()
  print(res[0], res[1])
except Exception as e:
  print("e", e, file=sys.stderr)

Submission status: Accepted

Solution code:
# coding:utf-8


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

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

    # s = max(min(s1a, s1b), min(s2a, s2b))
    # if min(s1a, s1b) == min(s2a, s2b):
    #     ans = 1
    s = W*H/2
    if x == W/2 and y == H/2:
        ans = 1

    print(s, ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(W*H/2, flag)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
W = i[0]
H = i[1]
x = float(i[2])
y = float(i[3])

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

area = W * H / 2

print(str(area) + " " + str(way))

Submission status: Accepted

Solution code:
a = input().split(" ")
w = int(a[0])
h = int(a[1])
x = int(a[2])
y = int(a[3])
s = w * h / 2
if w % 2 == 0:
    if h %  2 == 0:
        if x == int(w/2):
            if y == int(h/2):
                how = 1
            else:
                how = 0
        else:
            how = 0
    else:
        how = 0
else:
    how = 0
print(str(s) + " " + str(how))

Submission status: Accepted

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

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

else:
    print(s,0)

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    w,h,x,y = list(map(int, input().split()))

    menseki = w*h/2
    hoka = 0
    if(w/2 == x and h/2 == y):
        hoka = 1
    print("{0} {1}".format(menseki,hoka))

Submission status: Accepted

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

print(area/2, flag)

Submission status: Accepted

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

Submission status: Accepted

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

w,h,x,y= m()

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

Submission status: Accepted

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

Submission status: Accepted

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

    print(min_max,ans)

main()

Submission status: Accepted

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

p=W*H/2
hukusu=0
if x==W/2 and y==H/2:
    hukusu=1
print(str(p)+' '+str(hukusu))

Submission status: Accepted

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

S = "{0:.6f}".format(float(W*H/2))

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

Submission status: Accepted

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

if x * y == (w - x) * (h - y):
    sep = 1

print(w * h / 2, sep)

Submission status: Accepted

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: Accepted

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	w,h,x,y = map(int, io().split())
	s=(w*h)/2.0
	dd= 1 if (w/2==x and h/2 == y) else 0
	print('{:.2f}'.format(s) + ' ' + str(dd))
	#return ss, dd

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	main(io)
	#print (main(io))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(W: int, H: int, x: int, y: int):
    S = W * H / 2
    f = int((W == 2 * x) and (H == 2 * y))
    return "{} {}".format(S, f)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    result = solve(W, H, x, y)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools


# いくつか入力
w,h,x,y = (int(i) for i in input().split())  

if x > w//2:
    x = w - x
if y > h//2:
    y = h - y

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
W,H,x,y = map(int, input().split())
S = W*H/2.0 #長方形内であれば、中心からの対象点を選ぶ事により、2分割できる
flg = (W/2==x and H/2 ==y) #長方形の中心を通れば、2分割できる。そうじゃないとだめ

print(S,int(flg))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[W, H, x, y] = [int(i) for i in input().split()]
area = (W * H) / 2
flag = False

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

Submission status: Accepted

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

Submission status: Accepted

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

out1 = W*H / 2

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

print("%f %d" % (out1, out2))

Submission status: Accepted

Solution code:
inf = input().split()
W = int(inf[0])
H = int(inf[1])
x = int(inf[2])
y = int(inf[3])
 
s=W*H
if not s%2==0:
  s = s//2+0.5
else:
  s = s/2
st = "{0:.9f}".format(s)
if W%2==0 and H%2==0:
  gx = W//2
  gy = H//2
  if gx==x and gy==y:
    print(st, 1)
  else:
    print(st, 0)
else:
  print(st, 0)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(S,D)

Submission status: Accepted

Solution code:
W,H,x1,y1= map(int,input().split())   


ans = float(W*H/2)

if x1 == 1/2*W and y1 == 1/2*H :
    hantei = 1
else:
    hantei = 0

seikai = [ans,hantei]
print(' '.join(map(str, seikai)))

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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: Accepted

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)