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

Submission status: Accepted

Solution code:
import sys,heapq
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
def ddprint(x):
  if DBG:
    print(x)

w,h,x,y = inm()
printn(str(w*h/2) + ' ')
print(1 if 2*x==w and 2*y==h else 0)

Submission status: Accepted

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

area = W * H

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

Submission status: Accepted

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


def solve(W: int, H: int, x: int, y: int):
    result1 = W*H * 0.5
    if W*y == H*x and W*y == -H*x+H*W:
        result2 = 1
    else:
        result2 = 0
    print(result1, result2)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A

W, H, x, y = InputToInt()

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

Submission status: Accepted

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

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

Submission status: Accepted

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
    else:
        return H*W/2, 0

print(*calc())

Submission status: Accepted

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

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

print(str(W*H/2) + t)

Submission status: Accepted

Solution code:
def solve(w, h, x, y):
    area = w * h / 2.0
    if 2 * x == w and 2 * y == h:
        multi = 1
    else:
        multi = 0
    return area, multi


def main():
    w, h, x, y = (int(z) for z in input().split())
    area, judge = solve(w, h, x, y)
    print("{:.12f} {}".format(area, judge))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
w,h,x,y = map(float,input().split())
mx,my = w/2,h/2
res= []
res.append(w*h/2)
if x==mx and y==my:
    res.append(1)
else:
    res.append(0)
print(res[0],res[1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter, deque, defaultdict

# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7

# N = int(input())
# A = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]


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

area = H * W / 2

num = 0

e = 0.000001
if abs(x - W / 2) < e and abs(y - H / 2) < e:
    num = 1

print("{} {}".format(area, num))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

chuuw, chuuh = W/2, H/2

chuuten = 0

if x == chuuw and y == chuuh:
    chuuten = 1

menseki = W * H / 2

print("{:.10f} {}".format(menseki, chuuten))

Submission status: Accepted

Solution code:

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


if (W == x*2)and(H == y*2):
    result = '1'
else:
    result = '0'
print(format(W*H/2,'f')+' '+result)

Submission status: Accepted

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

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

Submission status: Accepted

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


W, H, x, y = inpl()

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 = [int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
import sys, itertools, collections
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

w, h, x, y = lmi()

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

print((w*h)/2, c)

Submission status: Accepted

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

Submission status: Accepted

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

area = W * H / 2
multi = 1 if (W / 2 == x and H / 2 == y) else 0

print(area, multi)

Submission status: Accepted

Solution code:
W, H, x, y = map(float, input().split()) # 横に2個


half = W * H / 2
print(half)

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

Submission status: Accepted

Solution code:
#n = int(input())
#m = int(input())
#k = int(input())
w, h, x, y = map(int, input().split())
#n, m, k = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
maxS = w*h/2
a = 0
if (w == 2*x) and (h == 2*y):
    a = 1
print('{:f} {}'.format(maxS, a))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
import itertools


#debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

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

    area = w * h
    half = area / 2.0

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

    print(half, flag)

solve()

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


DIV = 10**9+7

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    ans =0
    W,H,x,y = ints_raw()
    ans =W*H/2
    
    w2 = W/2
    h2 = H/2
    is_one = 1
    if w2 ==x and h2 ==y:
        is_one =1
    #elif w2==x or h2==y:
    else:
        is_one =0
    print(ans,is_one)
main()

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

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

print(w*h/2,a)

Submission status: Accepted

Solution code:
from decimal import *

W,H,x,y=map(int, input().split())
flag = '0'
if x==W/2 and y==H/2:
  flag = '1'
print(Decimal(W*H/2),flag)

Submission status: Accepted

Solution code:
import sys

fin = sys.stdin.readline
W, H, x, y = [int(elem) for elem in fin().split()]

center_x = W / 2
center_y = H / 2

if x == center_x and y == center_y:
    multi_hantei = 1
else:
    multi_hantei = 0

print((W*H)/2, multi_hantei)

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:
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

W,H,x,y=rl()
men = W*H/2
dif = 10**(-9)
ans = 0
if W/2-dif <= x and x <= W/2+dif and H/2-dif <= y and y <= H/2+dif:
    ans = 1 

print('{:.6f} {}'.format(men,ans))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def YesNo(x): return 'Yes' if x else 'No'
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    W, H, x, y = LI()
    s = W * H * 0.5
    d = 1 if (x == W / 2.0 and y == H / 2.0) else 0
    print(s, d)
    return

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

def solve():
    W,H,x,y = map(int, input().split())
    res = '{} {}'.format(W*H/2 ,int((W/2,H/2) == (x,y)))
    return res

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Solution code:
W,H,x,y  = [int(i) for i in 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())
mass = w * h / 2
if x == w/2 and y == h / 2:
    div = 1
else:
    div = 0
print(str(mass) + " " + str(div))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 16 20:56:35 2019

@author: Yamazaki Kenichi
"""

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

print(W*H/2)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 麺先
ans.append(str(W * H / 2))

#分割方法が複数
if x * 2 == W and y * 2 == H:
    ans.append('1')
else:
    ans.append('0')

print(' '.join(ans))

Submission status: Accepted

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


def solve(W: int, H: int, x: int, y: int):
    ret = W * H / 2
    tmp = 0
    if x * 2 == W and y * 2 == H:
        tmp = 1
    print(ret)
    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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

big = w*h/2
second = 0
if w/2==x and h/2==y:
    second = 1

print(big,second)

Submission status: Accepted

Solution code:
import math

#n = int(input())
w, h, x, y = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = input()
#list = list(s)

kotae = w * h / 2

flag = 0

if ( (w / 2 == x) and (h / 2 == y) ) :
    flag = 1


print(kotae, flag)

Submission status: Accepted

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

Submission status: Accepted

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

area_max = w * h / 2

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

print('{} {}'.format(area_max, way_num))

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 = [int(c) for c in input().split()]
n = 1 if x*2==W and y*2==H else 0
print(W*H/2, n)

Submission status: Accepted

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

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

W,H,x,y=MAP()

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

print(ans1, ans2)

Submission status: Accepted

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

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


m()

Submission status: Accepted

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

area = w * h / 2
flag = 2 * x == w and 2 * y == h
print("{} {}".format(area, int(flag)))

Submission status: Accepted

Solution code:
inp = input()
split_input = inp.split()
w = int(split_input[0])
h = int(split_input[1])
x = int(split_input[2])
y = int(split_input[3])
small_area = w * h / 2
if x*2 == w and y*2 == h:
    print(str(small_area) + " " + str(1))
else:
    print(str(small_area) + " " + str(0))

Submission status: Accepted

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

import sys, math, random
import numpy as np

# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = [int(input()) for _ in range(N)] # 1 row N column
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
# S.replace('ABC','X') # "testABCABC" -> "testXX"
 
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    W, H, x, y = list(map(int,input().split()))
    if W==x*2 and H==y*2:
        print("%f 1"%(W*H/2))
    else:
        print("%f 0"%(W*H/2))
    
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())
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 main():
    W, H, x, y = map(int, input().split())

    S = W*H/2

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

    print(S, m)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
W, H, x, y = [int(x) for x in input().split()]
half = W * H / 2
print(half, int((x, y)==(W/2, H/2)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

w,h,x,y = get_nums_l()

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

print(s, t)

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 / 2
if w / 2 == x and h / 2 == y:
    center = True
else:
    center = False

print(str(s) + " " + str(int(center)))

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right; from collections import Counter, defaultdict, deque, OrderedDict; from copy import deepcopy; from fractions import gcd; from functools import lru_cache, reduce; from math import ceil, floor; from sys import stdin, setrecursionlimit
import heapq as hq; import itertools as its; import operator as op


# globals
inf = float('inf')
input = stdin.readline


def main():
    w, h, x, y = get_li()
    area = w * h / 2
    multiple = 1 if w // 2 == x and w % 2 == 0 and h // 2 == y and h % 2 == 0 else 0
    print(area, multiple)
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


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


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


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

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:
    t = 1
else:
    t = 0
print(s, t)

Submission status: Accepted

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

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(float,input().split())
print((W*H)/2,(0,1)[x==W/2 and y==H/2])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(W, H, x, y):
    half = W * H / 2.0
    is_multiple = 1 if (x * 2 == W and y * 2 == H) else 0
    return half, is_multiple


if __name__ == '__main__':
    inputs = read()
    print("%.10f %d" % solve(*inputs))

Submission status: Accepted

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(str(a)+" "+str(b))

Submission status: Accepted

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

Submission status: Accepted

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

ansA = W * H / 2

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

print(ansA, ansB)

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('{0} {1}'.format(ans1, ans2))

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    w,h,x,y = f()

    print(w*h/2, end = ' ' )

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


solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

mm = w*h/2
mul = 0

if abs(w/2-x) < 0.001 and abs(h/2-y) < 0.001:
    mul = 1
else:
    mul = 0

print(mm,mul)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import string
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

W, H, X, Y = list(map(int, sys.stdin.readline().split()))

center = X * 2 == W and Y * 2 == H
print(W * H / 2, int(center))

Submission status: Accepted

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

menseki = w * h
bunkatu = x == w/2 and y == h/2

print(menseki / 2,1 if bunkatu else 0)

Submission status: Accepted

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


W,H,x,y = map(int, input().split())
s,pat = [float(W*H/2),0]
if x*2==W and y*2==H:
  pat = 1

print(s,pat)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

area = W * H / 2.

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

print('{} {}'.format(area,var))

Submission status: Accepted

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

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

Submission status: Accepted

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


def solve():
    W, H, x, y = list(map(int, input().split()))
    flag = int(W / 2 == x and H / 2 == y)
    return 0.5 * W * H, flag


def main():
    ans = solve()
    print(ans[0], ans[1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    W, H, X, Y = map(int, input().split())

    if W / 2 == X and H / 2 == Y:
        ans = [W * H/2, 1]
    else:
        ans = [W * H/2, 0]
    print(*ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

print(area,cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque  # 双方向キュー
from collections import defaultdict  # 初期化済み辞書
from heapq import heapify, heappush, heappop, heappushpop  # プライオリティキュー
from bisect import bisect_left, bisect_right  # 二分探索
#import numpy as np  # 1.8.2
#import scipy  # 0.13.3

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    W, H, x, y = i2nn()
    m = W * H / 2
    n = 0
    if W == x * 2 and H == y * 2:
        n = 1
    print('%f %d' % (m, n))

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(s,1)
else:
    print(s,0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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