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 = (int(i) for i in input().split())
area = W * H / 2
if W/2 == x and H/2 == y:
    possible = 1
else:
    possible = 0
print(area, possible)

Submission status: Accepted

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

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

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())
ans1=w*h/2
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 (y == H / 2 and x == W / 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())
ans = []

if w == x*2 and h == y*2:
    ans.append('{:.7f}'.format(w*h/2))
    ans.append(1)
else:
    ans.append('{:.7f}'.format(w*h/2))
    ans.append(0)

print(*ans, sep=' ')

Submission status: Accepted

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

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

print(w * h / 2, cnt)

Submission status: Accepted

Solution code:
import sys
from collections import deque
from collections import defaultdict
import math
import copy
input = sys.stdin.readline
sys.setrecursionlimit(20000000)
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(H*W/2, flag)

Submission status: Accepted

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

if x == W/2 and y == H/2:
  print(box_s,1)
else:
  print(box_s,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:
inp = list(map(int, input().split(" ")))
w = inp[0]
h = inp[1]
x = inp[2]
y = inp[3]

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

print(w*h*0.5, mp)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
w, h, x, y = map(int, input().split())

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

Submission status: Accepted

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

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

print(W*H/2, anscnt)

Submission status: Accepted

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



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

    #if(W * y == H * x or y * W ==  (-H * x) + W * H):
    print "%20.15f %d" % (float(H)/2.0 * W , ans2)
    return

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

    ans = max(min(H - y, y) * W, min(W - x, x) * H)
    print "%20.15f %d" % (float(ans), ans2)

if __name__ == '__main__':
    main()

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 = list(map(float,input().split()))
#横にラインを引く

if float(x) == W/2.0 and float(y) == H/2.0:
    print('{:9e}'.format(W*H/2.0),'1')
else:
    print('{:9e}'.format(W*H/2.0),'0')

Submission status: Accepted

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

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

print(W*H/2,f)

Submission status: Accepted

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

if 2 * x == W and 2 * y == 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())
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 = list(map(int,input().split()))

S_max = float(W*H/2)
pl = 0

if x == (W/2):
  if y == (H/2):
    pl = 1
  
print(str(S_max) + " " + str(pl))

Submission status: Accepted

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

Submission status: Accepted

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

def calculate(W, H, x, y):
	way = 0
	area = W*H/2.0
	if(x==W/2 and y==H/2):
		way = 1
	return area, way

area, way = calculate(W, H, x, y)

print("%f %d" % (area, way))

Submission status: Accepted

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

max_area = 0
square_area = w * h
multiple_ans = 1 if 2 * x == w and 2 * y == h else 0

print('{max_area} {multiple_ans}'.format(max_area=str(square_area / 2), multiple_ans=str(multiple_ans)))

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

flag = 0
if x + x == W and y + y == H:
    flag = 1

print(W * H / 2, flag)

Submission status: Accepted

Solution code:
# coding: utf-8# coding: utf-8
W, H, x, y = map(int, input().split())
flag = (2*x == W) & (2*y == H) 
print(W*H/2, 1 if flag else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W, H, x, y = map(int,input().split())
print(H*W/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())
print(W*H*0.5,1*(W/2==x and H/2==y))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!


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


if 2*x == w and 2*y == h:
    ans = 1
else:
    ans = 0
    

#print("{:.2f}".format(w*h/2.0), ans)
print(w*h/2, ans)
#print((10**10-1)/2.0)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#C問題、間違ってそうだから最後に提出

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = (W * H) / 2
anscnt = 0

if W - x == x and H - y == y:
    anscnt = 1
    
print(ans, end=' ')
print(anscnt)

Submission status: Accepted

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

Submission status: Accepted

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

sq0 = W*H/2

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

S = W * H / 2

if x == W / 2 :
  if y == H / 2 :
    n = 1
  else : 
    n = 0
else :
  n = 0
  
ans = str(S) + " " + str(n)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#整数＋リスト
w, h, x, y = list(map(int, input().split()))

f = 0
if ((x*2 == w) and (y*2 == h)):
    f = 1

print(w*h/2,f)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    w, h, x, y = map(int, input().split())
    s = w * h / 2

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    W, H, x, y = list(map(int, input().split()))
    split_num = int((x + x) == W and (y + y) == H)
    print("{:.6f} {}".format((W * H) / 2.0, split_num))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Solution code:
# 2019/06/16
# AtCoder Beginner Contest 130 - C

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

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

# Output
print(ans1, ans2)

Submission status: Accepted

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

print(ans, ans_flg)

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = W*H/2

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

print(ans1,ans2)

Submission status: Accepted

Solution code:
W, H, x, y = map(int,input().split())
cx = W/2
cy = H/2
if x == cx and y == cy:
    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 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 W / 2 == x and H / 2 == y:
  print("{} {}".format(W*H/2, 1))
else:
  print("{} {}".format(W*H/2, 0))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,H,x,y = map(float, input().split())
print((W*H)/2)
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()]
ans1 = W * H / 2
ans2 = 1 if (x*2==W and y*2==H) else 0
print(str(ans1) + " " + str(ans2))

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

print(S, some)

Submission status: Accepted

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

S = float(W)*H*(1/2)

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

Submission status: Accepted

Solution code:
class RectangleCutting:
    def __init__(self):
        W, H, x, y = map(int, input().split())
        self.W = W
        self.H = H
        self.x = x
        self.y = y

    def main(self):
        hs = self.H * self.W / 2

        if self.__is_center():
            print(hs, 1)
        else:
            print(hs, 0)

    def __is_center(self):
        if self.x * 2 == self.W and self.y * 2 == self.H:
            return True
        else:
            return False


rectangleCutting = RectangleCutting()
rectangleCutting.main()

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)

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

Submission status: Accepted

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


print (str(h*w/2)+" "+str(flag))

Submission status: Accepted

Solution code:
w,h,x,y = map(float,input().split())
if w-x==w/2 and h-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, input().split())
ans1 = W * H / 2
ans2 = int(W / 2 == x and H / 2 == y)
print(ans1, ans2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans,i)

Submission status: Accepted

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

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

S = W * H

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def c_rectangle_cutting(W, H, X, Y):
    return '{} {}'.format(H * W / 2, int(2 * X == W and 2 * Y == H))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
W, H, x, y = [int(_) for _ in stdin.readline().rstrip().split()]
ans1 = W*H/2
ans2 = int((x+x==W) and (y+y==H))
print(ans1, ans2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
if x + x == w and y + y == h:
    ans = 1

print("{} {}".format(w * h / 2, ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
W, H, x, y = map(int, input().split())
a = W*H/2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W,H,x,y=map(float, input().split())
 
#round1
A1=W*H/2
 
#round2
A2=0
if A1==min(x*H,(W-x)*H) and A1==min(y*W,(H-y)*W):
  A2=1

print(A1,A2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


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


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(W, H, x, y):
    if W/2 == x and H/2 == y:
        return (W*H)/2, 1

    return (W*H)/2, 0


def main():
    W, H, x, y = read_int_n()
    print('%f %d' % slv(W, H, x, y))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
w, h, x, y = map(int, input().split())
ans = []
ans.append(w * h / 2)
if w == x * 2 and h == y * 2:
    ans.append(1)
else:
    ans.append(0)
print(" ".join(map(str, ans)))

Submission status: Accepted

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


main()

Submission status: Accepted

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

sq = W*H /2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: 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(int,input().split())
buf_x = W-x
buf_y = H-y
if buf_x >= x:
  ver_area = H*x
else:
  ver_area = H*buf_x
if buf_y >= y:
  hori_area = W*y
else:
  hori_area = W*buf_y

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

Submission status: Accepted

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

print(W * H / 2, f)

Submission status: Accepted

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

space = W*H

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

Submission status: Accepted

Solution code:
w,h,x,y = map(int, input().split())
p = 0
if (x==0)|(x==w)|(y==0)|(y==h):
  mens = w*h/2
  p = 0
elif (x==(w/2))|(y==(h/2)):
  mens = w*h/2
  if (x==(w/2))&(y==(h/2)):
    p = 1
  else:
    p = 0
elif ((x/y)==(w/h))|(y == -(h/w)*x+h):
  p = 1
  mens = w*h/2
else:
  if ((y<h/w*x)&(y<-(h/w)*x+h))|((y>h/w*x)&(y>-(h/w)*x+h)):
    p = 0
    mens = w*h/2
  else:
    p = 0
    mens = w*h/2
print(mens, p)

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
if x == W/2:
    if y == H/2:
        counter+=1

if counter == 0:
    print(W*H/2, 0)
else:
    print(W*H/2, 1)

Submission status: Accepted

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



"""
import sys


def solve(W, H, x, y):
    if y == 0 or x == 0 or y == H or x == W:
        return W*H/2.0, 0

    if x == W/2:
        if y == H/2:
            return W*H/2.0, 1
        return W*H/2.0, 0
    if y == H/2:
        return W*H/2.0, 0

    w1 = x * H
    w2 = (W-x) * H
    ww1 = min(w1, w2)

    w3 = y * W
    w4 = (H-y) * W
    ww2 = min(w3, w4)
    if ww1 == ww2:
        return ww1, 1
    return W*H/2, 0


def main(args):
    W, H, x, y = map(int, input().split())
    ans = solve(W, H, x, y)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

x1=x*h
x2=(w-x)*h
y1=y*w
y2=(h-y)*w
f=0
if x==0 or y==0 or x==w or y==h:
    a=1/2*w*h
    f=1
else:    
    #a=max(0,min(x1,x2),min(y1,y2))
    a=1/2*w*h
    
if min(x1,x2)==min(y1,y2) and f==0:
    b=1
    
else:
    b=0
    
print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

area = float(W * H * 0.5)
mul = 0
if float(x) == W / 2 and float(y) == H / 2:
    mul = 1
print(area, mul)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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



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

Submission status: Accepted

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


multi_ans = 0

if ((x == 0 and y == 0) or (x == 0 and y == H) or (y == 0 and x == W) or (y == H and x == W)):
    multi_ans = 0
elif (W==H and not((x == W - x or y == H - y))):
    multi_ans == 1
elif (x != 0 and y != 0):
    if (W / x == H / y):
        if (x == W - x and y == H -y):
            multi_ans = 1
        else:
            multi_ans = 0

ans = W * H /2.0
print("{} {}".format(ans, multi_ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if x == W or y == H or x == 0.0 or y == 0.0:
    ans = H*W/2
    ans_2 = 0
elif x*H == y*W or (W-x)*H == y*W:
    ans = H*W/2
    if float(x) == W/2 and float(y) == H/2:
        ans_2 = 1
    else:
        ans_2 = 0
elif abs(W/2-x) * (H/2) / abs(H/2-y) < W/2:
    ans = H*W/2
    ans_2 = 0
else:
    yoko_a = W * y
    yoko_b = W * (H-y)
    yoko = min(yoko_a, yoko_b)

    tate_a = H * x
    tate_b = H * (W-x)
    tate = min(tate_a, tate_b)
    
    ans = max(tate, yoko)
    ans = float(ans)

    if tate == yoko:
        ans_2 = 1
    else:
        ans_2 = 0

print(ans, ans_2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans2 = 0
if w == 2*x:
    ans1 = x*h
    if h == 2*y and ans1==y*w:
        ans2 = 1
elif h == 2*y:
    ans1 = y*w
    if w == 2*x and ans1==x*h:
        ans2 = 1
else:
    a = -(h-2*y)/(2*x-w)
    b = -a*x+y
    ans1 = min(w*(a*w+2*b)/2, (2*h-a*w-2*b)*w/2)

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(('{} {}'.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())
print(w*h/2)
if x==w/2 and y==h/2:
	print(1)
else:
	print(0)

Submission status: Accepted

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

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

count = 0
s = 0
if 2 * x == W and 2 * y == H:
    s = W * H / 2
    count = 4
else:

    if (x == 0 and y == 0) or (x == 0 and y == H) or (x == W and y == 0) or (x == W and y == H):
        s = W * H / 2
        count = 1
    elif (x == 0 and 2 * y == H) or (x == W and 2 * y == H) or (2 * x == W and y == 0) or (2 * x == W and y == H):
        s = W * H / 2
        count = 1
    else:
        if 2 * x == W:
            s = W * H / 2
            count = 1

        elif 2 * y == H:
            s = W * H / 2
            count = 1
        else:
            a = (H - 2 * y) / (2 * x - W)
            if a > 0:
                if ((H + a * x - y) / a) <= W and ((a * x - y) / a) >= 0:
                    s = (H**2 / 2 + H * (a * x - y)) / a
                    count += 1

                a *= -1
                if ((H + a * x - y) / a) >= 0 and ((a * x - y) / a) <= W:
                    s = (H**2 / 2 + H * (a * x - y)) / a
                    count += 1


            elif a < 0:
                s = a * (W**2) / 2 + (y - a * x) * W
                if (a * W + y - a * x) >= 0 and (y - a * x) <= H:
                    count += 1
                a *= -1
                if (a * W + y - a * x) <= H and (y - a * x) >= 0:
                    count += 1



if count == 1:
    print("{0:.6f}".format(abs(s)),0)
else:
    print("{0:.6f}".format(abs(s)),1)

Submission status: Accepted

Solution code:
w, h, x, y = (int(i) for i in input().split())
a1 = w*h/2
a2 = 0
if( ((w==h) and (x == y and not((x==0 and y==0) or (x==w and y==h)))) or ((w!=h) and (x==w/2) and (y==h/2))  ):
    a2=1
print(a1, a2)

Submission status: Accepted

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

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

tate = min((W-x)*H , (x - 0)*H)
yoko = min((H-y)*W , (y - 0)*W)
k = max(tate,yoko)

if (x == W and y == 0) or (x == 0 and y == H) or (x == W and y == H) or (x == 0 and y == 0):
    k = (W*H)/2

if H == W:
    if x == y:
        k = (W*H)/2
    elif y + x == H:
        k = (W*H)/2



k = (W*H)/2
print(k,ans,sep=" ")

Submission status: Accepted

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

Submission status: Accepted

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

ans = W*H/2

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

Submission status: Accepted

Solution code:

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

s = W*H/2

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

print(s,f)