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: Wrong Answer

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

shape_1 = H*(W-x)
shape_2 = H*x
shape_3 = W*(H-y)
shape_4 = W*y

p = 0
square = max(min(shape_1, shape_2),min(shape_3, shape_4))

if x==W/2 and y==H/2: 
	p=1
print('{:f}'.format(square), p)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    W, H, x, y = map(int, input().split())
    X, Y = min(x, W-x) * H, min(y, H-y) * W
    print(max(X, Y), int(X > 0 and X == Y))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    W, H, x, y = map(int, input().split())
    X, Y = min(x, W-x) * H, min(y, H-y) * W
    print(max(X, Y), int(X == Y))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

    area = W * H / 2

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

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, u, v = map(int, input().split())

ans = [0, 0]

if H * u == W * v:
    ans[1] = 1

areaX = u * H if u < W / 2 else (W - u) * H
areaY = W * v if v < H / 2 else W * (H - v)
ans[0] = max(areaX, areaY)

print(*ans)

Submission status: Wrong Answer

Solution code:
W, H, u, v = map(int, input().split())

if u <= W / 2:
    areaX = H * u
else:
    areaX = H * (W - u)

if v <= H / 2:
    areaY = W * v
else:
    areaY = W * (H - v)

e = 10 ** (-8)
ans = []
if areaX - areaY < e:
    ans.append(areaX)
    ans.append(1)
elif areaX < areaY:
    ans.append(areaY)
    ans.append(0)
else:
    ans.append(areaX)
    ans.append(0)

print(*ans)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
men1 = min(h*x,h*(w-x))
men2 = min(w*y,w*(h-y))
check = 0
if w == 2*x and h == 2*y:
    check = 1
print("{} {}".format(float(max(men1,men2)),check))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
men1 = min(h*x,h*(w-x))
men2 = min(w*y,w*(h-y))

print("{} {}".format(float(max(men1,men2)),1 if men1 == men2 else 0))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
men1 = min(h*x,h*(w-x))
men2 = min(w*y,w*(h-y))

print(max(men1,men2),sep = " ",end = "")
if men1 == men2:
    print(" 1")
else:
    print(" 0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int,input().split())
sq1 = w*(h-y)
sq2 = w*y
sq3 = (w-x)*h
sq4 = x*h
sq12 = min(sq1,sq2)
if(sq1==0 or sq2==0):
  sq12 = max(sq1,sq2)
sq34 = min(sq3,sq4)
if(sq3==0 or sq4==0):
  sq34 = max(sq3,sq3)
jd = 0
if (sq12 == sq34):
  jd = 1
print(str(max(sq12,sq34))+" "+str(jd))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int,input().split())
sq1 = w*(h-y)
sq2 = w*y
sq3 = (w-x)*h
sq4 = x*h
sq12 = min(sq1,sq2)
sq34 = min(sq3,sq4)
jd = 0
if (sq12 == sq34):
  jd = 1
print(str(max(sq12,sq34))+" "+str(jd))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

area1 = min(H * x, H * (W - x))
area2 = min(W * y, W * (H - y))

method = "0"
if x == 0 and y == 0:
    pass
elif x == W and y == H:
    pass
elif area1 == area2:
    method = "1"


ans = max(area1, area2)
print(ans, method)

Submission status: Wrong Answer

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

area1 = min(H * x, H * (W - x))
area2 = min(W * y, W * (H - y))

if W == H:
    method = "0"
elif area1 == area2:
    method = "1"
else:
    method = "0"

ans = max(area1, area2)
print(ans, method)

Submission status: Wrong Answer

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

area1 = min(H * x, H * (W - x))
area2 = min(W * y, W * (H - y))

method = "0"
if area1 == area2 : method = "1"

ans = max(area1, area2)
print(ans, method)

Submission status: Wrong Answer

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

area1 = min(H * x, H * (W - x))
area2 = min(W * y, W * (H - y))

method = "0"
if area1 == area2 : method = "1"

ans = max(area1, area2)
print(float(ans), method)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int,input().split(" ")))
if x == 0:
    X_max = max(H * x,H * (W - x))
    Y_max = min(W * y,W * (H - y))
elif y == 0:
    X_max = min(H * x,H * (W - x))
    Y_max = max(W * y,W * (H - y))
else:
    X_max = min(H * x,H * (W - x))
    Y_max = min(W * y,W * (H - y))
if X_max == Y_max:
    print(str(X_max) + " 1")
else:
    print(str(max(X_max,Y_max)) + " 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int,input().split(" ")))
X_max = min(H * x,H * (W - x))
Y_max = min(W * y,W * (H - y))
if X_max == Y_max:
    print(str(X_max) + ".000000 1")
else:
    print(str(max(X_max,Y_max)) + ".000000 0")

Submission status: Wrong Answer

Solution code:
W,H,x,y = list(map(int,input().split(" ")))
X_max = min(H * x,H * (W - x))
Y_max = min(W * y,W * (H - y))
if X_max == Y_max:
    print(str(X_max) + " 1")
else:
    print(str(max(X_max,Y_max)) + " 0")

Submission status: Wrong Answer

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

R = W * H

a = min(x * H, R - x * H)
b = min(y * W, R - y * W)

if a == b:
    print(a, 1)
else:
    print(max(a, b), 0)

Submission status: Wrong Answer

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

R = W * H

r1 = x * H
r2 = y * W

if r1 == r2:
    print(r1, 1)
else:
    print(min(r1, r2), 0)

Submission status: Wrong Answer

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

print("{} {}".format(W * H // 2, p))

Submission status: Wrong Answer

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

if 0 < x and x < W:
    a = min(x * H, (W - x) * H)
else:
    a = -1

if 0 < y and y < H:
    b = min(W * y, W * (H - y))
else:
    b = -1

if a == b:
    p = 1
else:
    p = 0

print("{} {}".format(max(a, b), p))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 = min(x,W-x)
minY = min(y,H-y)
if(minX>minY):
	print(minX*H//2,end=" ")
else:
	print(minY*W//2,end=" ")
if(minX==minY):
	print(1)
else:
	print(0)

Submission status: Wrong Answer

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 = 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)
	exit()
else:
	print(0)
	exit()

Submission status: Wrong Answer

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

s = W * H
if x == 0:
    a = W * y
    b = W * (H - y)
    p = 1 if a == b else 0
elif y == 0:
    a = H * x
    b = H * (W - x)
elif W % x == 0 and H % y == 0:
    a = b = W * H // 2
else:
    a = W * y
    b = H * x

p = 1 if a == b else 0
print("{0} {1}".format(min(a, b), p))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq


# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# # from itertools import accumulate
# # from collections import deque

# from operator import mul
# from functools import reduce

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random

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

    
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

S = W * H

maxS = S / 2

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

s = W * H // 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
p1=(w-x)*h
p2=w*(h-y)
if p1==p2:
    t=1
else:
    t=0
print(float(min(w*h-p1,w*h-p2)),t)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
p1=(w-x)*h
p2=w*(h-y)
if p1==p2:
    t=1
else:
    t=0
print(min(w*h-p1,w*h-p2),t)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
s=min(x*h,(w-x)*h)
t=min(w*y,(h-y)*w)

if s==t:
    print(s, end=" ")
    print(1)
else:
    print(max(s,t),end=" ")
    print(0)

Submission status: Wrong Answer

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: Wrong Answer

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


def solve(W: int, H: int, x: int, y: int):
    if H*x==y*W:
        print(H*W/2,int(H/2==y and W/2==x))
    else:
        s = max(min(x,W-x)*H,min(y,H-y)*W)
        print(s,int(min(x,W-x)*H==min(y,H-y)*W))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(W, H, x, y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(W: int, H: int, x: int, y: int):
    is_various_way = (H%2==0 and y==H//2) and (W%2==0 and x==W//2)

    if H*x==y*W:
        print(H*W/2,int(is_various_way))
    else:
        s = max(min(x,W-x)*H,min(y,H-y)*W)
        print(s,int(is_various_way))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(W, H, x, y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


def solve(W: int, H: int, x: int, y: int):
    is_various_way = (H%2==0 and x==H//2) or (W%2==0 and y==W//2)

    if H*x==y*W:
        print(H*W/2,int(is_various_way))
    else:
        s = max(min(x,W-x)*H,min(y,H-y)*W)
        print(s,int(is_various_way))

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(W, H, x, y)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
# area=W*H
def func(a,b,c):
    return (a-b)*c,b*c
area1=list(func(W,x,H))
area2=list(func(H,y,W))
area1.sort()
area2.sort()
ans=[area1[0],area2[0]]
maxans=max(ans)
if x*2==W and y*2==H:
    print(maxans,1)
else:
    print(maxans,0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
# area=W*H
def func(a,b,c):
    return (a-b)*c,b*c
area1=list(func(W,x,H))
area2=list(func(H,y,W))
area1.sort()
area2.sort()
ans=[area1[0],area2[0]]
ans2=0
if ans[0]==ans[1]:
    ans2=1
else:
    ans2=0
print(max(ans),ans2)

Submission status: Wrong Answer

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

ans1 = w*h/2
if x == w/2 and y == h/2:
    ans2 = 1
elif (w > h and y == h/2) or (w < h and x == w/2):
    ans2 = 0
else:
    ans2 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

ans1 = w*h/2
if (w > h and h/2 == y) or (w < h and w/2 == x):
    ans2 = 0
else:
    ans2 = 1

print(ans1, ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
if x == int(w/2) and y == int(h/2):
	print (w/2*h,1)
	exit()
if x == int(w/2) or y == int(h/2):
	print (w*h/2,0)
	exit()
if y == h/w*x or y == -1*h/w*x + h:
	print (w*h/2,0)
	exit()
if x < w/2:
	a = x
else:
	a = w-x
if y < h/2:
	b = y
else:
	b = h-y
if a >= b:
	print (a*h,0)
else:
	print (w*b,0)

Submission status: Wrong Answer

Solution code:
import math

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

verleft = x * h
verright = (w - x) * h
sideup = y * w
sidedown = (h - y) * w
diagonal = (w * w) / 2

ans1 = 0
ans2 = 0

if (verleft >= verright):
    ans1 = verright
else:
    ans1 = verleft
if (sideup >= sidedown):
    ans2 = sidedown
else:
    ans2 = sideup

if (diagonal > ans1 and diagonal > ans2):
    print(diagonal)
    print("0")
else:
    if (ans1 == ans2):
        print(ans1)
        print("1")
    else:
        if (ans1 > ans2):
            print(ans1)
            print("0")
        else:
            print(ans2)
            print("0")

Submission status: Wrong Answer

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

verleft = x * h
verright = (w - x) * h
sideup = y * w
sidedown = (h - y) * w

ans1 = 0
ans2 = 0

if (verleft >= verright):
    ans1 = verright
else:
    ans1 = verleft
if (sideup >= sidedown):
    ans2 = sidedown
else:
    ans2 = sideup

if (ans1 == ans2):
    print(ans1)
    print("1")
else:
    if (ans1 > ans2):
        print(ans1)
        print("0")
    else:
        print(ans2)
        print("0")

Submission status: Wrong Answer

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

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

print(half, ans)

Submission status: Wrong Answer

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:
		ans_2 = 1

	ans_1 = (w*h) /2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

	ans_1 = (w*h) /2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

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

	ans_1 = (w*h) //2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_area = w * h

x_area = (w-x) * h
x_min = min(x_area,max_area - x_area)

y_area = (h-x) * w
y_min = min(y_area,max_area - y_area)

ans = str(max(x_min,y_min))
if x_min == y_min:
    ans += " 1"
else:
    ans += " 0"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = w*h
a = s*(x/w)
b = s*(y/h)
print(str(min(a, b))+" "+str(1 if a==b else 0))

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print('{:.12f}'.format(W * H / 2))
print(center)

Submission status: Wrong Answer

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

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

print('{:.10f}'.format(W * H / 2))
print(center)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x , y = map(int,input().split())
s = W*H
s1 = x*H
s2 = y*W
if s - s1 > s - s2:
  print(s-s1,end='')
else:
  print(s-s2,end='')
if s1 == s2:
  print(' '+"1")
else:
  print(' '+'0')

Submission status: Wrong Answer

Solution code:
W, H, x , y = map(int,input().split())
s = W*H
s1 = x*H
s2 = y*W
if s - s1 > s - s2:
  print(s-s1)
else:
  print(s-s2)
if s1 == s2:
  print("1", end="")
else:
  print('0',end='')

Submission status: Wrong Answer

Solution code:
W, H, x , y = map(int,input().split())
s = W*H
s1 = x*H
s2 = y*W
if s - s1 > s - s2:
  print(s-s1)
else:
  print(s-s2)
if s1 == s2:
  print('1',end = '')
else:
  print('0',end='')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
s1 = (w - x) * h
s2 = w * (h - y)
s3 = x * h
s4 = w * y
lis = []
if s1 >= s3:
    lis.append(s3)
else:
    lis.append(s1)
if s2 >= s4:
    lis.append(s4)
else:
    lis.append(s2)
if max(lis) == min(lis) or s1 == s2 or s3 == s4:
    a = 1
else:
    a = 0
print(str(max(lis)) + " " + str(a))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
s1 = (w - x) * h
s2 = w * (h - y)
s3 = x * h
s4 = w * y
lis = []
if s1 > s3:
    lis.append(s3)

else:
    lis.append(s1)
if s2 > s4:
    lis.append(s4)
else:
    lis.append(s2)
if max(lis) == min(lis) or s1 == s2 or s3 == s4:
    a = 1
else:
    a = 0
print(str(max(lis)) + " " + str(a))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
s1 = (w - x) * h
s2 = w * (h - y)
s3 = x * h
s4 = w * y
lis = []
if s1 > s3:
    lis.append(s3)
else:
    lis.append(s1)
if s2 > s4:
    lis.append(s4)
else:
    lis.append(s2)
if max(lis) == min(lis):
    a = 1
else:
    a = 0
print(str(max(lis)) + " " + str(a))

Submission status: Wrong Answer

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: Wrong Answer

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

a11 = w * y
a12 = w * (h-y)
a21 = x * h
a22 = (w-x) * h

a1 = min(a11, a12)
a2 = min(a21, a22)


def is_same_area(a, b):
    return abs(a - b) < 10 ** -9


if (x == w and y == h) or (x == 0 and y == 0):
    print("{} {}".format(w * h, 0))
else:
    print("{} {}".format(max(a1, a2), 1 if is_same_area(a1, a2) else 0))

Submission status: Wrong Answer

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

a11 = w * y
a12 = w * (h-y)
a21 = x * h
a22 = (w-x) * h

a1 = min(a11, a12)
a2 = min(a21, a22)


def is_same_area(a, b):
    return abs(a - b) < 10 ** -9


print("{} {}".format(max(a1, a2), 1 if is_same_area(a1, a2) else 0))

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if D1==D2:
    R = 1
  else:
    R = 0
else:
  D = 0.5*H*W
  R = 0
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if x==y and H==W:
    R = 1
  else:
    R = 0
else:
  D = 0.5*H*W
  R = 0
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if x==y:
    R = 1
  else:
    R = 0
else:
  D = 0.5*H*W
  R = 0
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  R = 1
else:
  D = 0.5*H*W
  R = 0
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if D1!=D2:
    R = 0
  else:
    R = 1
else:
  D = 0.5*H*W
  R = 0
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if D1!=D2:
    R = 0
  else:
    R = 1
else:
  D = 0.5*H*W
  if x != y:
    R = 0
  else:
    R = 1
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if D1!=D2:
    R = 0
  else:
    R = 1
else:
  D = 0.5
  if x != y:
    R = 0
  else:
    R = 1
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
if W-x < x:x = W-x
if H-y < y:y = H-y
D1 = x*H
D2 = y*W
if x !=0 and y!=0:
  D = max(D1,D2)
  if D1!=D2:
    R = 0
  else:
    R = 1
else:
  D = 0.5
  R = 1
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
D1 = min((W-x)*H,x*H)
D2 = min(W*(H-y),y*W)
D = max(D1,D2)
if D1!=D2:
  R = 0
else:
  R = 1
print(D, R)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int, input().split())
D1 = sorted([(W-x)*H,x*H])
D2 = sorted([W*(H-y),y*W])
D = max(D1[0],D2[0])
if D1[0]!=D2[0]:
  R = 0
else:
  R = 1
print(D, R)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print('{:.9f}'.format(s), n)

Submission status: Wrong Answer

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

max_x = min(y,w-y)
max_y = min(z,x-z)

max_x *= x
max_y *= w

if max_x < max_y:
    ans = max_y
    count = 0
elif max_y < max_x:
    ans = max_x
    count = 0
else:
    ans = max_x
    count = 1

if (y == 0 and z == 0) or (y == 0 and z == x) or (y == w and z == 0) or (y == w and z == x):
    ans = w * x / 2
    count = 0

print(ans, count)

Submission status: Wrong Answer

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

max_x = min(y,w-y)
max_y = min(z,x-z)

max_x *= x
max_y *= w

if max_x < max_y:
    ans = max_y
    count = 0
elif max_y < max_x:
    ans = max_x
    count = 0
else:
    ans = max_x
    count = 1

print(ans, count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

W, H, x, y = [int(x) for x in input().strip().split()]
c = 0
if x == W // 2 and y == H // 2:
  c += 1
print(W * H / 2, c)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
w,h,x,y=map(int,input().split())
#print(min(max(x*h,(w-x)*h),max(y*w,(h-y)*w)))
if w//2==x and h//2==y:
    print(float(w)*float(h)/2,1)
else:
    print(float(w)*float(h)/2,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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("{:.9f}".format(ans1), ans2)

Submission status: Wrong Answer

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: Wrong Answer

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