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: Runtime Error

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

sys.setrecursionlimit(10000000)

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

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

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

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


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

    W, H, x, y = il()

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

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

#print(W,H,x,y)
if x ==W/2 and y == H/2:
    area =  "{0:.6f}".format(float(x*H))
    print(area,1)
else:
    area ="{0:.6f}".format(float(min(W-x)*H,x*H))
    print(area,0)

Submission status: Runtime Error

Solution code:
 
s = w*h
 
if (w-x)*h > (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(0)
elif (w-x)*h == (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(1)
else:
    print(float((h-y))*w,end = " ")
    print(0)

Submission status: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
w,h,x,y=map(int,input().split())
ans1=(w*h)/2.0
ans=0
if (w/2==x)and(h/2==y):
    ans2=1
print('%f %d'%(ans1,ans2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
w,h,x,y=map(int,input().split())
sqx=min((w-x)*h,w*h-(w-x)*h)
sqy=min(w*y,w*h-w*y)
sqans=max(sqy,sqx)
flag=0
if y/x==h/w:
  flag=1  
  if sqans==0:
    sqans=w*h/2
    flag=0
  
ans=format(sqans,'.6f')
print(ans,flag)

Submission status: Runtime Error

Solution code:
w,h,x,y=map(int,input().split())
sqx=min((w-x)*h,w*h-(w-x)*h)
sqy=min(w*y,w*h-w*y)
sqans=max(sqy,sqx)
if y/x==h/w:
  flag=1  
else:
  flag=0
  
ans=format(sqans,'.6f')
print(ans,flag)

Submission status: Runtime Error

Solution code:
w,h,x,y=map(int,input().split())
sqx=min((w-x)*h,w*h-(w-x)*h)
sqy=min(w*y,w*h-w*y)
sqans=max(sqy,sqx)
if y/x==h/w:
  flag=1  
else:
  flag=0
  
ans=format(sqans,'.10f')
print(ans,flag)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)

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

area = max(min(w*y, w*(h-y)), min(x*h, (w-x)*h))
is_multi = 0

if x == w//2 and y == h//2
    is_multi = 1
    
print(area, is_multi)

Submission status: Runtime Error

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: Runtime Error

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

y_min = min(W*y, W*(H-y))
x_min = min(H*x, H*(W-x))

if y_min == x_min:
    ans = 1
else:
    ans = 0
print(f'{max(x_min, y_min):.08f}', ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define rep(i, N) for (ll i = 0; i < (N); i++)
#define For(i, a, b) for (ll i = (a); i < (b); i++)
#define all(A) (A).begin(), (A).end()

int main(){
    double W, H, x, y;
    cin >> W >> H >> x >> y;
    if (x * 2 == W and y * 2 == H) {
        cout << H / 2 * W << " " << 1 << endl;     
    }
    else cout << H / 2 * W << " " << 0 << endl;     


    return 0;
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

    print(W*H/2.0, pat)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

    area = 0
    pat = 0

    if (x == 0 and y == 0) or (x == 0 and y == H) or (x == W and Y == 0) or (x == W and y == H):
        area = W*H/2.0
        
    else:
        area_H = 0
        area_V = 0

        area_H = min(H - y, y) * W
        area_V = min(x, W - x) * H

        if area_H == area_V:
            pat = 1

        area = max(area_H, area_V)
        
    print(area, pat)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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//2=x and h//2=y:
    mul=1

print(ans,mul)

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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 (x==0 and y==0) or (x==w and y==0) or (x==0 and y==h) or (x==w and y==h):
    print((w*h)/2,0)
    sys.exit()
if w != x:
    if y/x == h/w or y/(w-x) == h/w:
        #print(y/x,h/w,y/(w-x))
        if y/x == h/w and y/(w-x) == h/w:
            print((w*h)/2,1)
        else:
            print((w*h)/2,0)
        sys.exit()
    
a1 = h*min(w-x,x)
a2 = w*min(h-y,y)

if a1 == a2:
    print(a1,1)
else:
    print(max(a1,a2),0)

Submission status: Runtime Error

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 (x==0 and y==0) or (x==w and y==0) or (x==0 and y==h) or (x==w and y==h):
    print((w*h)/2,0)
    sys.exit()
if y/x == h/w or y/(w-x) == h/w:
    #print(y/x,h/w,y/(w-x))
    if y/x == h/w and y/(w-x) == h/w:
         print((w*h)/2,1)
    else:
        print((w*h)/2,0)
    sys.exit()
    
a1 = h*min(w-x,x)
a2 = w*min(h-y,y)

if a1 == a2:
    print(a1,1)
else:
    print(max(a1,a2),0)

Submission status: Runtime Error

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

flg = 0
s=0

if x<=w/2 and y <= h/2:
    if x*h==w*y:
        flg=1
    s = max(x*h,w*y)

elif x<=w/2 and y>h/2:
    if x*h==w*(h-y):
        flg=1
    s = max(x*h,w*(h-y))
    
elif x>w/2 and y <= h/2:
    if (w-x)*h==w*y:
        flg==1:

    s = max( (w-x)*h , w*y)

elif x>w/2 and y > h/2:
    if (w-x)*h==w*(h-y):
        flg=1

    s = max( (w-x)*h, w*(h-y))

# if  x==w/2 and y==h/2:
#     flg = 1

# if w==h and x==y:
#     flg ==1

print(s,flg)

Submission status: Runtime Error

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)
#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: Runtime Error

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

if x == W/2 or y == H/2:
    area = H*W/2
    if y == (H/W)*x:
        dev = 1
    else:
        dev = 0

else:
    area = max(min(H*x,H(W-x)),min(W*y,W(H-y)))
    dev = 0
    
print(area, dev)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# 縦に分ける場合
s1, s2 = x * H, (W - x) * H

# 横に分ける場合
s3, s4 = W * y, W * (H - y)

ans = max(min(s1, s2), min(s3, s4))

if min(s1, s2) == min(s3, s4):
    print(f'{ans} 1')
else:
    print(f'{ans} 0')

Submission status: Runtime Error

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

#縦に分ける場合
s1, s2 = x * H, (W-x) *H

#横に分ける場合
s3, s4 = W * y, W * (H-y)

ans = max(min(s1,s2),min(s3,s4))

if min(s1,s2) == min(s3,s4):
    print(f'{ans} 1')
else:
    print(f'{ans} 0')

Submission status: Runtime Error

Solution code:
def do():
    w,h,x,y=map(int,input().split())
    ar1=(h-y)*w
    ar2=(w-x)*h
    if ar1==ar2:
        return "{} 1".format(ar2)
    elif w%x==0:
        return "{} 0".format(ar2)
    elif h%y==0:
        return "{} 0".format(ar1)
print(do())

Submission status: Runtime Error

Solution code:
def do():
    w,h,x,y=map(int,input().split())
    ar1=(h-y)*w
    ar2=(w-x)*h
    if w%x==0 and h%y==0:
        return "{} 1".format(ar2)
    elif w%x==0:
        return "{} 0".format(ar2)
    elif h%y==0:
        return "{} 0".format(ar1)
print(do())

Submission status: Runtime Error

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

Submission status: Runtime Error

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))
elif:
    cog_ans = 0
    print(str(area_ans) +" "+ str(cog_ans))

Submission status: Runtime Error

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

left = x * h
right = (w - x) * h
up = w * (h - y)
# down = w * y
area = left
cutting = 0
print("left, right, up, down : {} {} {} {}".format(left, right, up, down))

if left == right:
    area = left
elif up == down:
    area = up
elif left < right:
    if up < down:
        if left == up:
            area = left
            cutting = 1
        elif left < up:
            area = left
        else:
            area = up
    else:
        if left == down:
            area = left
            cutting = 1
        elif left < down:
            area = left
        else:
            area = down
else:
    if up < down:
        if right == up:
            area = right
            cutting = 1
        elif right < up:
            area = right
        else:
            area = up
    else:
        if right == down:
            area = right
            cutting = 1
        elif right < down:
            area = right
        else:
            area = down

print(area, cutting)

Submission status: Runtime Error

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

Submission status: Runtime Error

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*h2,0)

Submission status: Runtime Error

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

is_center = if x * 2 == W and y * 2 == H
min_square = W * H / 2

print(min_square, is_center)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
if x == w and y == h:
    area = area / 2
area = format(area, '.6f')
if x == w and y == h:
    area = area - 0.000001
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
area = format(area, '.6f') if area != 0 else 0
if x == w and y == h:
    area = area / 2
addit = 0 if prod1 != prod2  else 1
print("{} {}".format(area, addit))

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
if x == w and y == h:
    x = y = 0
prod1 = x * h
prod2 = y * w
area = min(prod1, prod2)
area = format(area, '.6f') if area != 0 else 0
addit = 0 if prod1 != prod2  else 1
print(f"{area} {addit}")

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
if x == w and y == h:
    prod1 = prod2 = (w * h) / 2
area = min(prod1, prod2)
# area = format(area, '.6f')
addit = 0 if prod1 != prod2 else 1
print(f"{area} {addit}")

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
if x == w and y == h:
    prod1 = prod2 = (w * h) / 2
area = min(prod1, prod2)
area = format(area, '.6f')
addit = 0 if prod1 != prod2 else 1
print(f"{area} {addit}")

Submission status: Runtime Error

Solution code:
coordinates = list(map(int, input().rstrip().split()))
w = coordinates[0]
h = coordinates[1]
x = coordinates[2]
y = coordinates[3]
prod1 = x * h
prod2 = y * w
if x == w and y == h:
    prod1 = prod2 = (w * h) / 2
area = min(prod1, prod2)
area = format(area, '.6f')
addit = 0 if prod1 != prod2 else 1
print(f"{area} {addit}")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

area_H = sorted([x * H, (W - x) * H])
area_W = sorted([y * W, (H - y) * W])

area_h = area_H[0]
area_w = area_W[0]

area = sorted([area_h, area_w])
switch = int(area[0] == area[1])

print(f"{float(area[1])} {switch}")

Submission status: Runtime Error

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

area_H = sorted([x * H, (W - x) * H])
area_W = sorted([y * W, (H - y) * W])

area_h = area_H[0]
area_w = area_W[0]

area = sorted([area_h, area_w])
switch = int(area_h == area_w)

print(f"{area[1]} {switch}")

Submission status: Runtime Error

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

ans = max(min(x/w, (w-x)/w), min(y/h,(h-y)/h))

print(ans, end=" ")
if min(x/w, (w-x)/w) = min(y/h,(h-y)/h):
	print(1):
else:
	print(0)

Submission status: Runtime Error

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

#x
left=x*h
right=(w-x)*h
x_smal=0
if(left < right):
	x_smal=left
else:
	x_smal=right

#y
down=y*w
up=(h-y)*w
y_smal=0
if(down < up):
	y_smal = down
else:
	y_smal = up

if(x_smal<y_smal):
	smal=y_smal
else:
	smal=x_smal
print("{:.6f} ".format(float(smal)),end="")

if((x==0)or(y==0))
	print(1):
	exit()

x_mod=w%x
y_mod=h%y
#print("xm:%d"%x_mod)
#print("ym:%d"%y_mod)
frg=0
if((x_mod == 0)and(y_mod == 0)):
	if(w/x == h/y):
		frg=1
if(frg==0):
	print(0)
else:
	print(1)

Submission status: Runtime Error

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

#x
left=x*h
right=(w-x)*h
x_smal=0
if(left < right):
	x_smal=left
else:
	x_smal=right

#y
down=y*w
up=(h-y)*w
y_smal=0
if(down < up):
	y_smal = down
else:
	y_smal = up

if(x_smal<y_smal):
	smal=y_smal
else:
	smal=x_smal
print("{:.6f} ".format(float(smal)),end="")

x_mod=w%x
y_mod=h%y
#print("xm:%d"%x_mod)
#print("ym:%d"%y_mod)
frg=0
if((x_mod == 0)and(y_mod == 0)):
	if(w/x == h/y):
		frg=1
if(frg==0):
	print(0)
else:
	print(1)

Submission status: Runtime Error

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

#x
left=x*h
right=(w-x)*h
x_smal=0
if(left < right):
	x_smal=left
else:
	x_smal=right

#y
down=y*w
up=(h-y)*w
y_smal=0
if(down < up):
	y_smal = down
else:
	y_smal = up

if(x_smal<y_smal):
	smal=y_smal
else:
	smal=x_smal
print("{:.6f} ".format(float(smal)),end="")

x_mod=w%x
y_mod=h%y
#print("xm:%d"%x_mod)
#print("ym:%d"%y_mod)
if((x_mod == 0)and(y_mod == 0)):
	if(w/x == h/y):
		print(1)
		exit()
print(0)

Submission status: Runtime Error

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

if y/x == H/W or y == -(H/W)*x + H:
    print("{} {}".format(W*H/2, f))

else:
    print("{} {}".format(max(min(x, W-x)*H, min(y, H-y)*W), f))

Submission status: Runtime Error

Solution code:
import sys
import os


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

    W, H, x, y = list(map(int, sys.stdin.buffer.readline().split()))
    P = 0

    if W == x or H == y:
        ret = W * H
    else:
        Py = x * H
        Px = y * W
        ret = max(Py, Px)
        
    P = 1 if Py == Px else 0
    print(ret, P)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
#include <iostream>
#include <cstdio>
#include <cctype>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdarg>
using namespace std;

int main(int argc, char const *argv[])
{
    int W, H, x, y;
    long long ans;
    cin >> W >> H >> x >> y;
  	ans = W * H;
    printf("%lf %d\n", ans / 2., (2 * x == W) && (2 * y == H));
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

WH = W*H
W,H,x,y = map(float,input().split(" "))

WH = W*H

w = (W-x)*H
h = (H-y)*W

if (WH-w)<w:
    w = (WH-w)
if (WH-h)<h:
    h = (WH-h)

if w>h:
    print("{} ".format(w),end="")
else:
    print("{} ".format(h),end="")

if w!=h:
    print("0")
else:
    print("1")

Submission status: Runtime Error

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

are_w = min(w*y, w*(h-y))
are_h = min(x*h, (w-x)*h)

ans_are = max(are_w, are_h)
ans = 0
if are_w == are_h:
    ans = 1

if x == w and y == h:
    ans_are = w*h/2
    ans = 0

if x == 0 and y == 0:
    ans_are = w*h/2
    ans = 0
    
if x == 0 and y == h:
    ans_are = w*h/2
    ans = 0

if x == w and y == 0:
    ans_are = w*h/2
    ans = 0

if w/h == x/y:
    ans_are = w*h/2
    ans = 0

print(ans_are, ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X, H, x, y = map(int, input().split())
S = X * H
max_small = S / 2

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

Submission status: Runtime Error

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

s=0
if (W-x)*H >= (H-y)*W:
    s=(W-x)*H
else:
    s=(H-y)*W

if W%x==0 and H%y==0:
    print(s,"1")
else:
    print(s,"0")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W, H ,x, y = map(int, input().split())
difx = W - x
dify = H - y
if W % x == 0 and H % y == 0:
    print(W * dify, 1)
else:
    if difx >= dify:
        print(difx* H, 0)
    else:
        print(dify * W,0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
w, h, x, y = list(map(int, input().split(' ')))
hoge = abs(y/x) == 1
print('%.6f %s' % ((w*h) / 2, int(hoge)))

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
w,h,x,y=list(map(int,input().split()))
ans=0
if w/x>h/y:s=x*h
elif w/x<h/y:s=w*y
else:
  s=x*h
  ans=1
print(s,ans)

Submission status: Runtime Error

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

  
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    with open('./input/input.txt') as f:
        W, H, x, y = map(int, f.input().split())
    ans = W * H / 2
    num = 1 if (2*x == W and 2*y == H) else 0
    print(ans, num)

  
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

area = []

a = W/2
if x >= b:
    area.append((W-x)*H)
elif b > x:
    area.append(x*H)
    
b = H/2
if y >= c:
    area.append((H-y)*W)
elif c > y:
    area.append(y*W)
    
ans1 = max(area)
if area.count(ans1) > 1:
    ans2 = 1
else:
    ans2 = 0
    
print(ans1, ans2)

Submission status: Runtime Error

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

area = []
a = y/x*W
if a <= H:
    area.append((1/2)*W*a)
elif a > H:
    area.append((1/2)*x/y*H*H)

b = W/2
if x >= b:
    area.append((W-x)*H)
elif b > x:
    area.append(x*H)
    
c = H/2
if y >= c:
    area.append((H-y)*W)
elif c > y:
    area.append(y*W)
    
ans1 = max(area)
if area.count(ans1) > 1:
    ans2 = 1
else:
    ans2 = 0
    
print(ans1, ans2)

Submission status: Runtime Error

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

a = y/x*W
if a < H:
    print((1/2)*W*a, 0)
elif a > H:
    print((1/2)*y/x*H*H, 0)
elif a == H:
    print((1/2)*W*a, 1)

Submission status: Runtime Error

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

a = y/x*W
if a < H:
    print((1/2)*W*a, 0)
elif a > H:
    print((1/2)*y/x*H, 0)
elif a == H:
    print((1/2)*W*a, 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W, H, x, y = map(int, input().split())
c = 0
if W == H or (x == W and y == H) or (x == 0 and y == H) or (x == W or y == 0) or (y == 0 and x == 0):
    c = 1
if x > W // 2:
    min1 = H * (W - x)
    if y > H // 2:
        mini2 = (H - y) * W
    else:
        mini2 = y * W
    
    print(max(mini1, mini2),c)

else:
    mini1 = x * H
    if y > H // 2:
        mini2 = (H - y) * W
    else:
        mini2 = y * W
    
    print(max(mini1, mini2),c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ans = 0
way = 0

if x == 0 and y == 0:
  ans = 0
  way = 0
elif x == 0:
  if H == y:
    ans = 0
    way = 0
  elif H - y > y:
    ans = W * y
    way = 0
  elif H - y < y:
    ans = W * (H-y)
    way = 0
  elif H - y == y:
    ans = W * (H-y)
    way = 0
elif y == 0:
  if W == x:
    ans = 0
    way = 0
  elif W - x > x:
    ans = x * H
    way = 0
  elif W - x < x:
    ans = (W-x) * H
    way = 0
  elif W - x == x:
    ans = (W-x) * H
    way = 0
elif x != 0 and y != 0:
  mi = 0

  s = (W-x) * H
  t = x * H

  if s > t:
    mi = t
  else:
    mi = s

  si = 0
  s = W * (H-y)
  t = W * y

  if s > t:
    si = t
  else:
    si = s

  if mi > si:
    ans = mi
    way = 0
  elif mi < si:
    ans = si
    way = 0
  elif mi == si:
    ans = mi
    way = 1

print("{} {}".format(ans, way))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

w2=w//2
h2=h//2

s1=h*w2
s2=w*h2
err1=(s1-s2)/s1
if -1.0*10**(-9)<err1 and err1<1.0*10**(-9):
    print(s1,1)
elif s1>s2:
    print(s1,0)
else:
    print(s2,0)

Submission status: Runtime Error

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

w2=w//2
h2=h//2

s1=h*w2
s2=w*h2
err1=(s1-s2)/s1
if -1.0*10**(-9)<err1<1.0*10**(-9):
    print(s1,1)
elif s1>s2:
    print(s1,0)
else:
    print(s2,0)

Submission status: Runtime Error

Solution code:
W, H, x, y = map(int,input().split())
duplicate = 1 if W/x==2 and H/y==2 else 0
x_min = min((W-x)*H, x*H)
y_min = min(W*(H-y), W*y)
area = max(x_min, y_min)
print(area, duplicate)

Submission status: Runtime Error

Solution code:
W,H,x,y = map(int,input().split())
if(W//2==x and H//2==y):
	print(W*H/2,end=" ")
	print(1)
	exit()
if(W//2==x or H//2==y):
	print(W*H/2,end=" ")
	print(0)
	exit()
minX = 0
minY = 0
min = 0
if not(W//2==x or H//2==y):
	minX = min(x,W-x)
	minY = min(y,H-y)
	if(minX>minY):
		print(minX*H//2,end=" ")
	else:
		print(minY*W//2,end=" ")
	if(x==y):
		print(1)
	else:
		print(0)

Submission status: Runtime Error

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

s = W * H
if W % x == 0 and H % y == 0:
    print("{0} {1}".format(W * H // 2, 1))
else:
    a = W * y
    b = H * x
    p = 1 if a == b else 0
    print("{0} {1}".format(min(a, b), p))

Submission status: Runtime Error

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

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

print((w * h / 2) + ' ' + center)

Submission status: Runtime Error

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

min_wh = w*h/2
a = 0

if x == 0 or y == 0:
    print(min_wh, 0)

if w%x==0 and h%y==0:
    a = 1
print(min_wh, a)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

	if w % 2 != 0 or h % 2 != 0 or x == 0 or y == 0:
		ans_2 = 0
	if w % 2 == 0 and h % 2 == 0 and w // 2 == x and h // 2 == y:
		ans_2 = 1

	ans_1 = (w*h) /2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()

Submission status: Runtime Error

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

	if w % 2 != 0 or h % 2 != 0:
		ans_2 = 0
	if w % 2 == 0 and h % 2 == 0 and w//2 == x and h // 2 == y:
		ans_2 = 1

	ans_1 = (w*h) /2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()