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:
def examA():
    N = I()
    ans = 0
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    W, H, x, y = LI()
    ans = W*H/2
    if x*2==W and y*2==H:
        print(ans, 1)
    else:
        print(ans, 0)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    N = I()
    R = [inf, -inf]
    L = [inf, -inf]
    U = [inf, -inf]
    D = [inf, -inf]
    X = [inf, -inf]
    Y = [inf, -inf]
    for _ in range(N):
        x, y, s = LSI()
        x, y = int(x), int(y)
        if s == "R":
            if x < R[0]: R[0] = x
            if x > R[1]: R[1] = x
            if y < Y[0]: Y[0] = y
            if y > Y[1]: Y[1] = y
        elif s == "L":
            if x < L[0]: L[0] = x
            if x > L[1]: L[1] = x
            if y < Y[0]: Y[0] = y
            if y > Y[1]: Y[1] = y
        elif s == "U":
            if y < U[0]: U[0] = y
            if y > U[1]: U[1] = y
            if x < X[0]: X[0] = x
            if x > X[1]: X[1] = x
        elif s == "D":
            if y < D[0]: D[0] = y
            if y > D[1]: D[1] = y
            if x < X[0]: X[0] = x
            if x > X[1]: X[1] = x

    def calc_area(t):
        x = max(R[1] + t, L[1] - t, X[1]) - min(R[0] + t, L[0] - t, X[0])
        y = max(U[1] + t, D[1] - t, Y[1]) - min(U[0] + t, D[0] - t, Y[0])
        if x <= 0 or y <= 0:
            return 0
        return x * y

    ans = calc_area(0)
    for i in [0, 1]:
        for j in [0, 1]:
            if R[i] <= X[j]:
                T = (X[j] - R[i])
                ans = min(ans, calc_area(T))
            if L[i] >= X[j]:
                T = (L[i] - X[j])
                ans = min(ans, calc_area(T))
            if R[i] <= L[j]:
                T = dec((L[j] - R[i]) / 2)
                ans = min(ans, calc_area(T))

            if U[i] <= Y[j]:
                T = (Y[j] - U[i])
                ans = min(ans, calc_area(T))
            if D[i] >= Y[j]:
                T = (D[i] - Y[j])
                ans = min(ans, calc_area(T))
            if U[i] <= D[j]:
                T = dec((D[j] - U[i]) / 2)
                ans = min(ans, calc_area(T))

    print(ans)
    return

from decimal import Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examC()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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());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());print((w*h)/2,sum([2*x==w and 2*y==h]))

Submission status: Accepted

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

def main():

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

    ans = []

    if x == W / 2 and y == H / 2:
        ans.append(W * H / 2)
        ans.append(1)

    else:
        ans.append(W * H / 2)
        ans.append(0)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def II():
    return int(sys.stdin.readline())


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


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


def main():
    W, H, x, y = MI()
    ans = W * H / 2
    has_other = 1 if W / 2 == x and H / 2 == y else 0

    print(ans, has_other)


main()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Accepted

Solution code:
# abc130_c.py
# https://atcoder.jp/contests/abc130/tasks/abc130_c

# C - Rectangle Cutting /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 300点

# 問題文
# 平面上に長方形があり、4つの頂点の座標は (0,0),(W,0),(W,H),(0,H) です。
# この長方形の内部または周上の点 (x,y) が与えられます。
# (x,y) を通る直線で長方形を 2つの部分に分割するとき、 面積の大きくない方の面積の最大値を求めてください。
# また、その最大値を達成する分割の方法が複数あるかも判定してください。

# 制約

#     1≤W,H≤109
#     0≤x≤W
#     0≤y≤H
#     入力はすべて整数である

# 入力
# 入力は以下の形式で標準入力から与えられる。
# W H x y

# 出力
# はじめに、面積の大きくない方の面積の最大値を出力せよ。
# つづいて、その最大値を達成する分割の方法が複数あるなら 1 を、そうでないなら 0 を出力せよ。 
# 出力された面積は、絶対誤差あるいは相対誤差が 10−9以下の時正答と判定される。

# 入力例 1
# 2 3 1 2

# 出力例 1
# 3.000000 0

# 直線 x=1で分割するのが最適です。また、最適な分割方法はこれ以外には存在しません。

# 入力例 2
# 2 2 1 1

# 出力例 2
# 2.000000 1


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    W, H, x, y = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    # (x,y)が中心点だったら
    if W == x*2 and H == y*2:
        flag = 1
    else:
        flag = 0

    area = W*H*0.5

    return [area, flag]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2 3 1 2']
        lines_export = ['3.000000 0']
    if pattern == 2:
        lines_input = ['2 2 1 1']
        lines_export = ['2.000000 1']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
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:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    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:
        r = x * h
        print(r, 1)
    else:
        print(w * h / 2, 0)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    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:
        r = x * h
        print(r, 1)
    elif w / x == 2 or h / y == 2:
        if w / x == 2:
            r = x * h
            print(r, 0)
        else:
            r = y * w
            print(r, 0)
    else:
        print(w * h / 2, 0)

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:
  print("{} {}".format(s, 1))
else:
  print("{} {}".format(s, 0))

Submission status: Accepted

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

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

print(w*h/2, out)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
x=0
if a/2==c and b/2==d:
  x=1
s=str((a*b)/2)+" "+str(x)
print(s)

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 print(W*H/2,0)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

area = W * H / 2
ways = 0
if x == W / 2 and y == H / 2:
    ways += 1

print(area, ways)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

def multi(w, h, x, y):
    core = (w/2, h/2)
    if (x == core[0])^(y == core[1]):
        return False
    elif x == core[0]:
        return True
    else:
        return False

print(w*h/2, 1 if multi(w, h, x, y) else 0)

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

w,h,x,y = I()
s = w*h/2
if w % 2 != 0 or h % 2 != 0:
    cnt = 0
else:
    if x == w//2 and y == h // 2:
        cnt =1
    else:
        cnt = 0

print("{} {}".format(s,cnt))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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,end=' ')
    print(1)
else:
    print(w*h/2,end=' ')
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int, input().split())

x1 = a/2
y1 = b/2

if x1 == c and y1 == d:
    print(a*b/2,1)
else:
    print(a*b/2,0)

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:
  print('{:.06f}'.format(area),"1")
else:
  print('{:.06f}'.format(area),"0")

Submission status: Accepted

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

def main(w,h,x,y):
    s=w*h/2
    center=0
    if 2*x==w and 2*y==h:
        center=1
    return s,center

if __name__=='__main__':
    w,h,x,y=readinput()
    ans=main(w,h,x,y)
    print(ans[0],ans[1])

Submission status: Accepted

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

center_x = W / 2
center_y = H / 2

area = W * H / 2

if center_x == x and center_y == y:
    print(f"{area} 1")
else:
    print(f"{area} 0")

Submission status: Accepted

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

a = w*h/2

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

Submission status: Accepted

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

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

print(str(a)+" "+str(b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(h * w / 2, cnt)

Submission status: Accepted

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

s = w*h/2 
ans = int((w/2, h/2) == (x, y))
print(s, ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    w, h, x, y = [int(x) for x in input().split()]
    print((w*h)/2, int(w == 2 * x and h == 2 * y))

        



t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""



"""

Submission status: Accepted

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

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:
def resolve():
    '''
    code here
    '''
    W, H, x, y = [int(item) for item in input().split()]

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

    print(W*H/2, res)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

if (x==W/2 and y==H/2):#passing through right in the middle
    print(W*H/2,1)
else:
    print(W*H/2,0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 12, 2020 21:58:18 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from sys import stdin
input = stdin.readline


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

  cx, cy = W/2, H/2
  epsilon = 1e-9
  is_multi = 1 if abs(x-cx) < epsilon and abs(y-cy) < epsilon else 0
  print(W*H/2, is_multi)


if(__name__ == '__main__'):
  main()

Submission status: Accepted

Solution code:
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


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

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


if __name__ == "__main__":
    main()

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:
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())
  
W,H,x,y=input2()

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

s = W * H / 2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

# In[5]:


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


# In[7]:


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


# In[ ]:

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

w,h,x,y = readInts()

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

print(w*h/2,d)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    W,H,x,y = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    half=(W*H/2)
    if W==x*2 and H==y*2:
        print(half,1)
    else:
        print(half,0)




if __name__ == "__main__":
    main()

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

print(ans, flag)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

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

w = W / 2
h = H / 2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = w*h/2

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

Submission status: Accepted

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

Submission status: Accepted

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

if x == 0 or x == W:
  tmp1 = H-y
  tmp2 = y
  print((tmp1+tmp2)*W/2, 0)
elif y == 0 or y == H:
  tmp1 = W-x
  tmp2 = x
  print((tmp1+tmp2)*H/2, 0)
elif x == W/2 and y == H/2:
  print(W*H/2, 1)
else:
  tmp1 = W-x
  tmp2 = H-y
  if tmp1 == x:
    print(x*H, 0)
  elif tmp2 == y:
    print(y*W, 0)
  else:
    a = (tmp2-y)/(tmp1-x)
    b = -a*x+y
    if 0 <= b <= H:
      print((b+(H-b))*w/2, 0)
    else:
      tmp = -b/a
      print((tmp+(W-tmp))*H/2, 0)

Submission status: Accepted

Solution code:
if __name__=="__main__":
    w,h,x,y=[int(x) for x in input().split()]

    a=(w*h)/2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    W, H, x, y = mi()

    s = W*H/2
    cut = 1 if W/2 == x/1 and H/2 == y/1 else 0

    print(s, cut)

    return

main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def solve():
    gx,gy = False, False
    if W/2 == x:
        gx = True
    if H/2 == y:
        gy = True
    ans = W*H/2
#    print(gx,gy)
    if gx and gy:
        print(ans, 1)
    else:
        print(ans, 0)

    

if __name__ == "__main__":
    W,H,x,y = list(map(float, input().split()))
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    w, h, x, y = map(int, input().split())
    print(float(w)*float(h)/2, int(2*x == w and 2*y == h))
    
if __name__ == '__main__':
    main()

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())
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())
ans = w * h / 2
way = 0

if w == 2*x and h == 2*y:
    way += 1
    
print(ans,way)

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.buffer.readline
import os
from math import*


w,h,x,y=map(int,input().split())
area=w*h
#ans1=min((w*y),(area-(w*y)))
#ans2=min((x*h),(area-(x*h)))
#if ans1==ans2:
#	print(ans1,1)
#else:
#	print(max(ans1,ans2),0)
print((area/2),1 if x==w/2 and y==h/2 else 0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
W,H,X,Y=map(int,input().split())
m = W*H/2
i = 0
if W%2 < 1 and H%2 < 1 and W//2 == X and H//2 == Y:
    i = 1
print(m,i)

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:
read = lambda: list(map(int, input().split()))
w, h, x, y = read()
sq = w * h / 2
if w == x * 2 and h == y * 2:
    print(sq, 1)
else:
    print(sq, 0)

Submission status: Accepted

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

#print(W,H,x,y)
area =  "{0:.6f}".format(float(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())

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

Submission status: Accepted

Solution code:
def main():
    w, h, x, y = list(map(int, input().split()))
    is_center = 1 if x*2 == w and y*2 == h else 0
    print(f'{w*h / 2.0} {is_center}')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
ans=0
if a==2*c and b==2*d:
  ans=1
print(a*b/2,ans)

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())
a = w * h / 2
if x * 2 == w and y * 2 == h:
  b = '1'
else:
  b = '0'
print(str(a) + ' ' + b)

Submission status: Accepted

Solution code:
import bisect,copy,heapq,itertools,string
from collections import *
from math import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

w,h,x,y = MAP()
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())
a = []
a.append(w*h/2)
if x*2==w and y*2==h:
  a.append(1)
else:
  a.append(0)
print(' '.join(map(str,a)))

Submission status: Accepted

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

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

Submission status: Accepted

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


if b/2 == y and a/2 == x:
    ans2 = 1
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:
    ans2 = 1
else:
    ans2 = 0

print(ans,ans2)

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)