Problem:


Score : 300 points

Problem Statement

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

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

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

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

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

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

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1



Sample input:
2 3 1 2


Sample output:
3.000000 0

Submission status: Wrong Answer

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

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

    min_x = min(x, W-x)
    min_y =  min(y, H-y)
    if min_x* H >min_y*W:
        return min_x* H, 0
    else:
        return min_y*W, 0

print(*calc())

Submission status: Wrong Answer

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

if abs(W/2-x) > abs(H/2-y):
    A = W*y
    B = W*(H-y)
    print(min(A,B), 0)
elif abs(H/2-y) > abs(W/2-x):
    A = H*x
    B = H*(W-x)
    print(min(A,B), 0)
else:
    print((W*H)/2, 1)

Submission status: Wrong Answer

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

P = W * H
d1 = x * H
d2 = (W - x) * H
mi1 = min(d1, d2)
d3 = y * W
d4 = (H - y) * W
mi2 = min(d3, d4)
print(max(mi1, mi2), int(mi1 == mi2))

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(n) for n in input().split()]
X = min((W-x)*H, (x)*H)
Y = min(W*(H-y), W*y)
print(max(X, Y), 0 if X != Y else 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 = min((W - x) * H, x * H)
    b = min((H - y) * W, y * W)
    if a == b:
        print(a, 1)
    else:
        print(max(a,b),0)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
m=W*H-min(W*y,W*(H-y),x*H,(W-x)*H)
ans=0
if 2*x==W:
  ans=1
if 2*y==H:
  ans=1
if W==H:
  if x==y:
    ans=1
  if x+y==W:
    ans=1
print(str(m)+" "+str(ans))

Submission status: Wrong Answer

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

menseki = W * H / 2
if x == W // 2 and y == H // 2:
    houhou = 1
else:
    houhou = 0

print(menseki, houhou)

Submission status: Wrong Answer

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: Wrong Answer

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

box_s = H*W

min_x = min(box_s*(x/W),box_s*((W-x)/W))
min_y = min(box_s*(y/H),box_s*((W-y)/H))
print(max(min_x,min_y))
if min_x == min_y:
  print(1)
else:
  print(0)

Submission status: Wrong Answer

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


W, H, x, y = inpl()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！

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

Submission status: Wrong Answer

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

if W == 0 or H == 0:
  print(0, 1)
  exit()

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

Submission status: Wrong Answer

Solution code:
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 == h:
    if x == y and w//2 == x:
        print("{0} {1}".format(w*h/2,1))
    else:
        print("{0} {1}".format(w*h/2,0))
else:
    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: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

sizes = []
sizes.append([x * H, (W - x) * H])
sizes.append([W * y, (W - x) * y])

if W == y or H == x:
    print(max(map(min, sizes)), 0)
else:
    print(max(map(min, sizes)), 1)

Submission status: Wrong Answer

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()
    vertical_line_area = min(x * h, h * (w - x))
    horiz_line_area = min(y * w, w * (h - y))
    if horiz_line_area == vertical_line_area:
        print(horiz_line_area, 1)
    else:
        print(max(vertical_line_area, horiz_line_area), 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: Wrong Answer

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 = min((W - x) * H, x * H)
    b = min((H - y) * W, y * W)
    if a == b:
        print(a, 1)
    else:
        print(max(a,b))
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Wrong Answer

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

if W == 0 or H == 0:
  print(0, 0)
  exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#2分割して小さい方が一番でかいようにする

if abs(W/2-x) > abs(H/2-y):
    A = W*y
    B = W*(H-y)
    print(min(A,B), 0)
elif abs(H/2-y) > abs(W/2-x):
    A = H*x
    B = H*(W-x)
    print(min(A,B), 0)
else:
    A = H*x
    B = H*(W-x)
    print(min(A,B), 1)

Submission status: Wrong Answer

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

# x = x
area_x = H * (min(x, W-x))
area_y = (min(y,H-y) * W)

print(max(area_x, area_y))
print(1 if area_x == area_y else 0)

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

first=x*h
second=(w-x)*h

mazu=min(first, second)

first=y*w
second=(h-y)*w

tugi=min(first, second)

#print(mazu, tugi)
if mazu==tugi:
    print(mazu, 1)
else:
    print(mazu, 0)

Submission status: Wrong Answer

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

if W*y == H*x:
    print(area, 1)
elif W*y == -H*x + H*W:
    print(area, 1)
else:
    print(area, 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y =map(int, input().split())
men=w*h
bun1=x*h
bun2=(w-x)*h
bun3=w*y
bun4=w*(h-y)
if min(bun1,bun2)==min(bun3,bun4):
    ans=1
else:
    ans=0
print(max(min(bun1,bun2), min(bun3,bun4)), ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x>=W//2:
    res = (W-x)*H
else:
    res = x*H

if y>=H//2:
    res2 = (H-y)*W
else:
    res2 = y*W

print("{} {}".format(max(res,res2),is_double))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(W: int, H: int, x: int, y: int):
    ret1 = H * min(W - x, x)
    ret2 = W * min(H - y, y)
    tmp = 0
    if ret1 == ret2:
        tmp = 1
    print(max(ret1, ret2))
    print(tmp)
    return


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
    solve(W, H, x, y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(W*H/2, ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

################################################################################

a, b, x, y = map(int, input().split())

area1 = min(x, a-x) * b
area2 = min(y, b-y) * a

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min1 = min(W * y, W * (H-y))
min2 = min(H * x, H * (W-x))

print (max(min1, min2), end = ' ')
if min1 == min2:
    print (1)
else:
    print (0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


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


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

print(w*h/2, ans)

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
num=0
if N[2]*2==N[0] & N[3]*2==N[1]:
    num=1
print(N[0]*N[1]/2," ",num)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

#たてに分割
left = x*h
right = (w-x)*h
min1 = min(left,right)

down = y*w
up = (h-y)*w
min2 = min(down,up)

t = 0
if min1 == min2:
    t = 1
print(max(min1,min2),t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

D=[0]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
W, H, x, y = map(int, input().split())
if x*y == 0 or (x-W)*(y-H) ==0 or (x == W/2 and y != H/2) or (x != W/2 and y == H/2) :
  print(str(W*H/2) + ' 0')
  exit()
else:
  for i in range(W+1):
    if x == i and y == H / W * x and x != W/2:
      print(str(W*H/2) + ' 0')
      exit()
    if x == i and y == W - H / W * x and x != W/2:
      print(str(W*H/2) + ' 0')
      exit()
print(str(W*H/2) + ' 1')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# 長方形のど真ん中の点を通る直線で分ければ半分にできます
w,h,x,y = map(float,input().split())
half_w = w / 2
half_h = h / 2
max_area = w * h / 2
if x == half_w and y == half_h:
  print("{:.9f} 1".format(max_area))
  
else:
  print("{:.9f} 0".format(max_area))

Submission status: Accepted

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

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

Submission status: Accepted

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

S = W * H * 0.5

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

print(S,a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w,h,x,y=map(int,input().split())
#面積が大きくない方の最大値
s=0.5*w*h
#複数存在するかの判定
i=0
if 2*x==w and 2*y==h:
    i+=1
print(s,i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

s = 0;

if w==x*2 and h==y*2 : s += 1

print(h*w/2,s)

Submission status: Accepted

Solution code:
import sys
w,h,x,y = map(float,input().split())
S = w*h/2
if x*2== w:
  if y*2 == h:
    print(f'{S:.08f}' + " 1")
    
    sys.exit()
print(f'{S:.08f}' + " 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())
cnt = 0
if 2*x == W and 2*y == H:
    cnt = 1
print(W*H*0.5,cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = w * h / 2

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

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:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    W,H,x,y = mi()

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




if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 12 11:04:24 2020

@author: liang
"""

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

ans = [0] * 2

ans[0] = H*W/2
if x == W/2 and y == H/2:
    ans[1] = 1
else:
    ans[1] = 0
print(" ".join(map(str, ans)))

Submission status: Accepted

Solution code:
def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = [0, 1]

print(w*h/2, ans[w == 2 * x and h == 2 * y])

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:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
INF = 10**19
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
S = a[0]*a[1]/2
if a[0]/2 == a[2] and a[1]/2 == a[3]:
  print(S,1)
else:
  print(S,0)

Submission status: Accepted

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