Problem:


Score : 300 points

Problem Statement

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

Constraints

1 \leq W,H \leq 10^9

0\leq x\leq W

0\leq y\leq H

All values in input are integers.

Input

Input is given from Standard Input in the following format:

W H x y

Output

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

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

Sample Input 1

2 3 1 2

Sample Output 1

3.000000 0

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

Sample Input 2

2 2 1 1

Sample Output 2

2.000000 1



Sample input:
2 3 1 2


Sample output:
3.000000 0

Submission status: Accepted

Solution code:
W,H,x,y = map(float, input().split())
c_w,c_h,other = W/2,H/2,0

if c_h==y and c_w==x:
  other = 1
  print('%f %d'%(W*H/2,other))
  
elif c_h==y or c_w==x:
  if c_w==x: print('%f %d'%(min(W-x, x)*H,other))
  elif c_h==y: print('%f %d'%(min(H-y, y)*W,other))
    
else: 
  print('%f %d'%(W*H/2,other))
 
#長方形を区切る二つの点の座標を求める
'''
else:
  y_ = (c_h-y)/(c_w-x)
  #縦型台形
  if abs(y_*c_w)>=c_h:
    point_ = [[-c_h/y_+c_h,0],[c_h/y_+c_h,c_h*2]]
    S = (point_[0][0]+point_[1][0])*abs((point_[1][1]-point_[0][1]))/2
    print('%f %d'%(S,other))
  elif abs(y_*c_w)<c_h:
    point_ = [[0,-c_w*y_+c_w],[c_w*2,c_w*y_+c_w]]
    S = (point_[0][1]+point_[1][1])*abs((point_[1][0]-point_[0][0]))/2
    print('%f %d'%(S,other))
'''

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#from collections import defaultdict, deque, Counter
#from bisect import bisect_left
#import heapq
#import math
#from itertools import groupby as gb
#from itertools import permutations as perm
#from itertools import combinations as comb
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

#n = int(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split())
W,H,x,y = map(int, stdin.readline().rstrip().split())
#AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(n)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# C - Rectangle Cutting

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

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

s = (W*H)/2

print(s,flg)

Submission status: Accepted

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

def main():
    W, H, x, y = map(int, readline().rstrip().split())
    ans = W * H / 2
    if x == W / 2 and y == H / 2:
        mult = 1
    else:
        mult = 0
    print(ans, mult)


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())
print(W*H/2,end=" ")
if x==W/2 and y==H/2:
  print(1);exit()

print(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:
#!/usr/bin/env python3
w, h, x, y = map(float, 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())

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    W, H, x, y = map(int, input().split())
    if 2*x == W:
        Fx = True
    else:
        Fx = False
    if 2*y == H:
        Fy = True
    else:
        Fy = False
    if Fx and Fy:
        way = 1
    else:
        way = 0
    area = H*W/2
    # print(area," ", way)
    print(area, way)

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().strip().split())
print(w*h/2,1*(x*2==w and y*2==h))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(' '))
maximum = W * H / 2
flag = 0
if x == W / 2 and y == H / 2:
  flag = 1
print("{0} {1}".format(maximum, flag))

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

"""
import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）
"""

import sys
readline = sys.stdin.buffer.readline
w,h,x,y=map(int,readline().rstrip().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:
import sys
input = sys.stdin.readline
 
 
W,H,x,y = map(int,input().split())
 
D=[0]
 
if x==W/2 and y==H/2:
    print(W*H/2,1)
else:
    print(W*H/2,0)

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

ans = w*h/2

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

Submission status: Accepted

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

area = W*H

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

square = W * H / 2

center_x = W / 2
center_y = H / 2

unique_flag = False

if center_x == x and center_y == y:
    unique_flag = True
    
if unique_flag:
    print(square, 1)
else :
    print(square, 0)

Submission status: Accepted

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

s = w * h / 2
res = 1 if 2*x==w and 2*y==h else 0

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

Submission status: Accepted

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

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

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

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(w == 2*x and h == 2*y))

Submission status: Accepted

Solution code:
W, H, x, y = list(map(int,input().split()))
judge = 0
#綺麗に二等分するのが面積は最善である。
area = float(W * H / 2)
#(x,y)を通るときもう一点は自動的に(y,x)になる。だがx == yの時は別に考える。
"""
・図形を二等分する直線が二つ以上ある
・その二つの直線の中点が重なりそれが点(x,y)となる
この二つの条件を満たせば複数の分割法があると言える。
これを考えるとW,Hが偶数値で、x,yはそれぞれx = W/2, y = H/2でなくてはならない
"""
if W % 2 == 0 and H % 2 == 0:
  if x == int(W / 2) and y == int(H / 2):
    judge += 1
#結果
print(area, judge)

Submission status: Accepted

Solution code:
def do():
    w,h,x,y=map(int,input().split())
    ar=w*h
    if w/2==x and h/2==y:
        return "{} 1".format(ar/2)
    else:
        return "{} 0".format(ar/2)
print(do())

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

Submission status: Accepted

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

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(
  H * W / 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())


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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
w,h,x,y=map(int,input().split())
cnt=w*h/2
bl = (2*x==w and 2*y==h)
t = 1 if bl else 0

print(cnt,t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    W,H,x,y=map(int,readline().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S = W * H / 2

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    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)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if w / 2 == x and h / 2 == y:
    flg = True
else:
    flg = False

S = w * h / 2
    
if flg:
    print(S,1)
else:
    print(S,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())
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())
centet = (w/2,h/2)


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
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())
w, h, x, y = map(int, input().split())
s = (w * h) / 2
if w%2 == 0 and w//2 == x and h%2 == 0 and h//2 == y:
    print(s, '1')
else:
    print(s, '0')

Submission status: Accepted

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

menseki=W*H
n=menseki/2

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

if count==0:
  print(n,0)
else:
  print(n,1)

Submission status: Accepted

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

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:
def myAnswer(W:int,H:int,x:int,y:int) -> None:
   if(x+x==W and y + y == H):
      print(float(W)*float(H)/2,1)
   else:
      print(float(W)*float(H)/2,0)

def modelAnswer():
   return
def main():
   W,H,x,y = map(int,input().split())
   myAnswer(W,H,x,y)
if __name__ == '__main__':
   main()

Submission status: Accepted

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

i = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

S = W * H / 2
print(S, t)

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 = list(map(int, input().split()))
#b = list(map(int, input().split()))
print((w*h)/2, end=" ")

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

Submission status: Accepted

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

    # 最大になるのは面積のちょうど半分
    ans1 = W * H / 2

    # (x,y)が長方形の中心の場合1
    ans2 = 0
    if x*2 == W and y*2 == H:
        ans2 = 1

    print('{0:.6f} {1}'.format(ans1, ans2))


if __name__ == '__main__':
    q3()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/C-RectangleCutting.py
#
w, h, x, y = map(int, input().split())
cutting = 0
if w == 2 * x and h == 2 * y:
  cutting += 1
print(w*h/2, cutting)

Submission status: Accepted

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

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

calc = w * h / 2
flg = 0
if w/2 == x and h/2 == y:
    flg = 1
print(str(calc) + ' ' + str(flg))

Submission status: Accepted

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

area = w*h/2
ans = 0

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

print(area, ans)

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

W, H, x, y = LI()

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

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

Submission status: Accepted

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

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    w, h, x, y = mi()
    g_x = w/2
    g_y = h/2
    ans = "{} {}".format(w*h/2, 1) if x==g_x and y==g_y else "{} {}".format(w*h/2, 0)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w, h, x, y = [int(i) for i in 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,end=' ')

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

Submission status: Accepted

Solution code:
# Problem C - Rectangle Cutting

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

# initialization
ans = (W * H) / 2
is_ok = (x*2==W) and (y*2==H)

if is_ok:
    print("%f %d"%(ans, 1))
else:
    print("%f %d"%(ans, 0))

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

print(ans, p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
  print(W*H/2, "0")
  exit()

a = min(x*H,(W-x)*H)
b = min(y*W,(H-y)*W)
tmp = '0'
if a == b:
    tmp = '1'
print(W*H/2,tmp)

Submission status: Accepted

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

if (x == 0 and y == 0) or (x==0 and y==h) or (x==w and y==0) or(x==w and y==h):
    print(w*h/2,'0')
    exit()

a = min(x*h,(w-x)*h)
b = min(y*w,(h-y)*w)
tmp = '0'
if a == b:
    tmp = '1'
print(w*h/2,tmp)

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


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

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

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


if __name__ == '__main__':
    solve()

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:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1


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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(w*h/2, ' ', ans)

Submission status: Accepted

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

c = 0
if X==W/2 and Y==H/2:
    c = 1

print(W*H/2.0,c)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

W, H, x, y = MAP()

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(int,input().split())
if x!=w/2 or y!=h/2:
  print(w*h/2,0)
else:
  print(w*h/2,1)

Submission status: Accepted

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

is_center = int(x * 2 == W and y * 2 == H)
min_sq = W * H / 2

print("{} {}".format(min_sq, is_center))

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

Submission status: Accepted

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

ans = W*H/2

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

Submission status: Accepted

Solution code:
# solution
import io

nim,mike,x,y=map(int,input().split())

print(nim*mike/2, 1 if x==nim/2 and y==mike/2 else 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())
div, rem = zip(divmod(W, 2), divmod(H, 2))
print(W * H / 2, int(div == (x, y) and not any(rem)))

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

w, h, x, y = map(int, sys.stdin.readline().split())

def main():
    s = w * h / 2
    t = x * 2 == w and y * 2 == h; t *= 1
    print(s, t)

if __name__ ==  '__main__':
    main()

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

Submission status: Accepted

Solution code:


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


if __name__ == "__main__":
    resolve()