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(float, raw_input().split(' '))

multi = False
if x == W/2 and y == H/2:
    multi = True

M = W * H / 2

print M, 1 if multi else 0

Submission status: Accepted

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

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

print("{0:.6f} {1}".format(ans, div))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())

w,h,x,y=intinput()
print(str((w*h/2))+" "+str(int(w%2==0 and h%2==0 and w//2==x and h//2==y)))

Submission status: Accepted

Solution code:
# coding: utf-8
import time
import re
import math

def main():
    w,h,x,y=map(int,input().split())
    f=0
    if w/2==x and h/2==y:
        f=1
    print("{} {}".format(w*h/2,f))
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#n=int(input())
# global n,A,s,memo,mx,mn,L,B

Submission status: Accepted

Solution code:
W, H, x, y = list(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())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [W, H, x, y] = string_to_int(inputs[0])
    max = (W * H) / 2
    is_multi = 0
    if x == W / 2 and y == H / 2:
        is_multi = 1

    return "%.6f %d" % (max, is_multi)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(str(W*H/2) + " " + str(ans))

Submission status: Accepted

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

if (x == 0) or (x == W) or (y == 0) or (y == H) or (H / W * x).is_integer():
    if (x == W / 2) and (y == H / 2):
        print(W * H / 2, 1)
    else:
        print(W * H / 2, 0)
else:
    ans1 = min(x * H, (W - x) * H)
    ans2 = min(W * y, W * (H - y))
    if ans1 == ans2:
        print(ans1, 1)
    else:
        print(max(ans1, ans2), 0)

Submission status: Accepted

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

max= W * H / 2
check = 0
if W/2 == x:
    if H/2 == y:
        check = 1

print(max,check)

Submission status: Accepted

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

if(x == W/2 and y == H/2):
    hantei = 1

print(W*H/2,hantei)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

ans_m = (w*h)/2
ans_p = 0

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

print(ans_m, ans_p)

Submission status: Accepted

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

S = W * H * 0.5

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

Submission status: Accepted

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


max_s = W * H /2

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


print(str(max_s) + " " + str(ans))

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

ans = str(a) + ' ' + str(b)
print(ans)

Submission status: Accepted

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

c_x = w/2
c_y = h/2

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

Submission status: Accepted

Solution code:
from fractions import Fraction
W, H, x, y = map(int, input().split())
if Fraction(W, 2) == x and Fraction(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())
ans = w*h/2
op = 0
if w/2 == x and h/2 == y:
    op = 1
print(ans,op)

Submission status: Accepted

Solution code:
w,h,x,y = list(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())

# 長方形の対角線の交点を通る直線は長方形を2等分にするので交点を求める
a = W / 2
b = H / 2
area = W * H / 2
cnt = 0
if a == X and b == Y:
    cnt = 1

print(area,cnt)

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

print(Area, cases)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# n=int(input())
# a,b=map(int, input().split())
# c=list(map(int, input().split()))
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# a=100
# b=0.987654321
# print('{0:06d}-{1:6f}'.format(a,b))  # 0埋めのときの出力
# 000100-0.987654

import numpy as np
import math
import copy

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

area = float((w * h) / 2)
print(area)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

if __name__ == '__main__':
    W, H, x, y = [int(x) for x in stdin.readline().rstrip().split()]

    max = (W * H) / 2

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
tate_flag = False
yoko_flag = False

#縦のチェック
if (w/2 == x):
    tate_flag = True
    
#横のチェック
if (h/2 == y):
    yoko_flag = True
    

if tate_flag == True and yoko_flag == True:
    count = 1

print(w * h / 2, count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W, H, x, y = list(map(int, 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())
m = 0
multi = 0

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

print(' '.join(map(str, [w*h/2, multi])))

Submission status: Accepted

Solution code:
def main():
    w, h, x, y = map(int, input().split())
    print('%.6f %d' % solve(w, h, x, y))

def solve(w, h, x, y):
    r = w * h / 2
    if x == w / 2 and y == h / 2:
        return (r, 1)
    else:
        return (r, 0)

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

area = W*H/2

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

print("%.9f" % area, ways)

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:
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
w,h,x,y=IL()
if w%2==0 and h%2==0 and 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().strip().split())

a = W * H / 2
b = 0
if W % 2 == 0 and H % 2 == 0 and W // 2 == x and H // 2 == y: b = 1

print('{} {}'.format(a, b))

Submission status: Accepted

Solution code:
W,H,x,y = map(int, raw_input().split())
S = 0.0 + W*H
S = S/2
t = 0
if(W/2 == x and W%2 == 0 and H%2 == 0 and H/2 ==y):
	t = 1
ans = "{0:.2f}".format(S)+" "+str(t)
print(ans)

Submission status: Accepted

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

c = [w/2, h/2]  # center

if x == c[0] and y == c[1]:
  area = w * h / 2
  mul = 1
else:
  area = w * h / 2
  mul = 0

print(area, mul)

Submission status: Accepted

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

x_s = W /2
y_s = H /2
area = W * y_s
if x_s == x and y_s == y:
    print("{0:.6f}".format(area),1)
else:
    print("{0:.6f}".format(area),0)

Submission status: Accepted

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

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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

W, H, x, y = LI()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import random
import collections
import math
import itertools
import bisect

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



def solve():
    pass


def main():
    if False and 'PYCHARM_HOSTED' in os.environ:
        main_pycharm()
    else:
        real_main()


from copy import deepcopy
def main_pycharm():
    solution = solve

    test_inputs = None
    test_outputs = None
    judge = None
    slow_solution = None
    if solution is not None:
        if test_outputs is not None:
            test_with_answers(solution, test_inputs, test_outputs)
        if judge is not None:
            test_with_judge(solution, test_inputs, judge)
        if slow_solution is not None:
            test_with_slow_solution(solution, test_inputs, slow_solution)


def test_with_answers(solution, inputs_answers):
    total, wrong = 0, 0
    for args, test_ans in inputs_answers:
        ans = solution(*args.copy())
        if ans != test_ans:
            print('WRONG! ans=%s, test_ans=%s, args=%s' % (ans, test_ans, args))
            wrong += 1
        else:
            print('GOOD')
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_judge(solution, inputs_gen, judge):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        if not judge(deepcopy(ans), *deepcopy(args)):
            print('WRONG! ans=%s, args=%s' % (ans, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


def test_with_slow_solution(solution, inputs_gen, solution_slow):
    total, wrong = 0, 0
    for args in inputs_gen:
        ans = solution(*deepcopy(args))
        slow = solution_slow(*deepcopy(args))
        if ans != slow:
            print('WRONG! ans=%s, slow=%s, args=%s' % (ans, slow, args))
            wrong += 1
        total += 1
    print('ALL %d TESTS PASSED' % total if not wrong else '%d out of %d tests are WRONG' % (wrong, total))


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

def read():
    return input()

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

def read_array(sep=None, maxsplit=-1):
    return input().split(sep, maxsplit)

def read_int_array():
    return [int(a) for a in read_array()]

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(str(W*H/2)+" "+str(jug))

Submission status: Accepted

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

if (w%2==0 and w//2==x and h%2==0 and h//2==y):
  print("%.11f" % (w*h/2), 1)
else:
  print("%.11f" % (w*h/2), 0)

Submission status: Accepted

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

cp = ((W / 2), (H / 2))
np = (x, y)

print(W * H / 2, [0, 1][not(cp != np)])

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

print(ans, flg)

Submission status: Accepted

Solution code:
#a, b, c, d = (int(i) for i in input().split())  
#W = [int(i) for i in input().split()] 
import math

W, H, x, y = (int(i) for i in input().split())
flag=0
if W/2 == x and H/2 == y:
    flag = 1
    pass

mense = W*H/2
print(mense, flag)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())

# 多次元配列の宣言（あとでintにすること。）（タプルにすること。）
dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break
# 累積和
add = 1 # 問題によって決まる
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)

#２分探索
li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

#ソート関数
org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)
# [3, 1, 4, 5, 2]
# [1, 2, 3, 4, 5]

#Distance Transformation
    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""



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

    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w, h, a, b = map(int, input().split())

# # y = (a - w / 2)(X - a) + b
# if a == w / 2:
#     ans = w * h / 2
# elif b == h / 2:
#     ans = w * h / 2
# elif a - w / 2 >= w / h or a - w / 2 >= -1 * (w / h):
#     key = (h + a * a - w / 2 * a - b) / (a - w / 2)
#     ans = key * (w - key) * h / 2
# else:
#     key = -a * a + w / 2 * a + b
#     ans = key * ( h - key) * w / 2
ans = w * h / 2
ans2 = 0
if a == w / 2 and b == h / 2:
    ans2 = 1
print(ans, ans2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from decimal import Decimal
W, H, x, y = map(int, raw_input().split())
d_W = Decimal(str(W) + ".0")
d_H = Decimal(str(H) + ".0")

menseki = d_W * d_H * Decimal("0.5")

val = 0
if x == W * 0.5 and y == H * 0.5:
  val = 1

print(str(menseki) + " " + str(val))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

W, H, x, y = [int(v) for v in input().rstrip('\n').split()]

area = W * H

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

Submission status: Accepted

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

Submission status: Accepted

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

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('%f 1' % (s/2))
else:
    print('%f 0' % (s/2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
W, H, x, y = inpl()
if W == x*2 and H == y*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())
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(' '))

S = W*H/2

f = False
if W % 2 == 0 and H % 2 == 0:
	if x == W//2 and y == H//2:
		f = True


print(S,int(f))

Submission status: Accepted

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

ans = w*h/2

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

print(ans, a)

Submission status: Accepted

Solution code:
W,H,x,y = (int(i) for i in input().split())
hoge = 0
if W / 2 == x and H / 2 == y and H > 0 and W > 0:
    hoge = 1

print(str(W*H/2) +" " + str(hoge))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
#from collections import deque, defaultdict, Counter
#from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
#from itertools import permutations, combinations, product
#from operator import itemgetter, mul
from copy import deepcopy,copy
#from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd


def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

W, H, x, y = MAP()

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

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:
W, H, x, y = map(int,input().split())

# 範囲内なら必ず等分できるので問題なし
square = 1.0 * W * H / 2

# ちょうど真ん中なら2パターンの切り分けがある
patt = 0
if 1.0 * W / 2 == x and 1.0 * H / 2 == y:
    patt = 1

print(square, patt)

Submission status: Accepted

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