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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    w, h, x, y = map(int, readline().split())
    ans = '{:.10f}'.format(w*h/2) 
    print(ans, end=' ')
    if (2*x == w) and (2*y == h):
        print(1)
    else:
        print(0)
if __name__ == '__main__':
    main()

Submission status: Accepted

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


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


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

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(W*H/2, is_one)

Submission status: Accepted

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

Submission status: Accepted

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

M = W*H

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

total = w*h
ans = total/2
route = 0
if w == x*2 and h == y*2:
    route = 1

print(ans, route)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

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

# quad = [[0,0],[W,0],[W,H],[0,H]] 
# S = (quad[1][0]-quad[0][1]) * (quad[2][1]-quad[0][1])
S = W*H
ans = 0

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

print(S/2 , ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

W,H,x,y = IL()

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

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
W, H, x, y = map(int, input().split())
tmp = 0

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

    print('{:f}'.format((H*W)/2), 0)
    exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m,x,y = inpl()
res = 0
if n%2==0 and m%2==0 and n//2==x and m//2==y:
    res = 1
print((n*m)/2,res)

Submission status: Accepted

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

Solution code:

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

Submission status: Accepted

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

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,int(x==W/2 and y==H/2))

Submission status: Accepted

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

quad = [[0,0],[W,0],[W,H],[0,H]] 
S = (quad[1][0]-quad[0][1]) * (quad[2][1]-quad[0][1])
ans = 0

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

print(S/2 , ans)

Submission status: Accepted

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


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


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)

# UnionFind
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


# ワーシャルフロイド (任意の2頂点の対に対して最短経路を求める)
# 計算量n^3 (nは頂点の数)
def warshall_floyd(d, n):
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d


# ダイクストラ
def dijkstra_heap(s, edge, n):
    #始点sから各頂点への最短距離
    d = [10**20] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 2数の最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

# リストの要素の最小公倍数
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

# リストの要素の最大公約数
def gcd_list(numbers):
    return reduce(gcd, numbers)

# 素数判定



# limit以下の素数を列挙
def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

# 同じものを含む順列
def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        # set（集合）型で重複を削除、ソート
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret


# ここから書き始める
w, h, x, y = map(int, input().split())
area = w * h / 2
if x == w / 2 and y == h / 2:
    print(area, 1)
else:
    print(area, 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans1, ans2)

Submission status: Accepted

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

s = W*H/2
print(s)

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

Submission status: Accepted

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

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:
a,b,c,d=map(int,input().split())
if a/2==c and b/2==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())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# check
ans = (W * H) / 2

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

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


resolve()

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

    if x == W/2 and y == H/2:
        pat = 1

    print((W*H)/2.0, pat)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
w,h,x,y=map(int,input().split())
print('{:.10f}'.format(w*h/2),int(x*2==w and y*2==h))

Submission status: Accepted

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


gx, gy = W / 2.0, H / 2.0

if (gx == x) and (gy == y):
    tar = '1'
else:
    tar = '0'

print(ans, tar)

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

w,h,x,y = iim()
area = w*h/2

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

Submission status: Accepted

Solution code:
import collections
import numpy as np
import sys
import copy

W,H,X,Y=map(int,input().split())
#A=list(map(int,input().split()))

if W/2==X and H/2==Y:
    print(X*H,1)


else:
    print(H*W/2,0)

Submission status: Accepted

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import numpy as np
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))


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

print(ans,mul)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

print(w*h/2,ans)

Submission status: Accepted

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

area = w*h
ans = (w/2==float(x) and h/2==float(y))
print(area/2,(1 if ans else 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:
W, H, x, y = list(map(int, input().split()))
if x == W / 2 and y == H / 2:
    print('{} {}'.format(W * H / 2, 1))
else:
    print('{} {}'.format(W * H / 2, 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(W*H/2, flg)

Submission status: Accepted

Solution code:
W, H, X, Y = map(int, input().split())

ans1 = (W*H)/2
if W == X*2 and H == Y*2:
    ans2 = 1
else:
    ans2 = 0
print(ans1, ans2)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
W, H, X, Y = map(int, input().split())

ans1 = (W*H)/2
# if X==W//2 and Y==H//2:
if W==X*2 and H==Y*2:
    ans2 = 1
else:
    ans2 = 0
print(ans1, ans2)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

"""
直方体は中身を通る線で半分に割ることができる
"""

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rectangle_cutting(w, h, x, y):

    a = 0
    ans = (w*h) / 2

    if x*2 == w and y*2 == h:
        a = 1

    return ans, a
def main():
    w, h, x, y = map(int, input().split())
    print(*(rectangle_cutting(w, h, x, y)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print('{:.6f}'.format(float(W*H/2)), end=" ")

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

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

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

print(area, n)

Submission status: Accepted

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

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

ans = w * h / 2

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

print(ans, flag)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    w,h,x,y=L()
    print(w*h/2,end=" ")
    print(1 if w/2==x and h/2==y else 0)
    

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 00:13:44 2020

@author: shinba
"""
import sys

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

if w%2 == 0 and h%2 == 0:
    if w//2 == x and h//2 == y:
        print((h*w)/2,1)
        sys.exit()
        
print(h*w/2,0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = H * W / 2

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


print(split_area_smax, vari_split)

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

scale = (w * h) / 2


if x == w/2 and y == h/2:
  print('{0:.9f} 1'.format(scale))
else:
  print('{0:.9f} 0'.format(scale))

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


solve()

Submission status: Accepted

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

ans = 0
if ((W/2)==x) & ((H/2)==y):
    ans = 1

print(W*H/2, ans)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


w, h, x, y = Is()
xd = w/2
yd = h/2
s = w*h/2

if xd == x and yd == y:
    print("{} {}".format(s, 1))
else:
    print("{} {}".format(s, 0))

Submission status: Accepted

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

ans = 0
if x + x == a and y + y == b:
    ans = 1
else:
    ans = 0
print(a * b / 2, ans)