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())
#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):
    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 max(x*h,(w-x)*h)==max(y*w,(h-y)*w):
    print(min(max(x*h,(w-x)*h),max(y*w,(h-y)*w)),1)
else:
    print(min(max(x*h,(w-x)*h),max(y*w,(h-y)*w)),0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float,input().split())
a = min(x*w,w*h-x*w)
b = min(y*w,w*h-y*w)
ans = 0
if a==b:
  ans = 1
print(str(max(a,b))+" "+ str(ans))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
a = min(x*w,w*h-x*w)
b = min(y*w,w*h-y*w)
ans = 0
if a==b:
  ans = 1
print(str(max(a,b))+" "+ str(ans))

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
a = min(x*w,w*h-x*w)
b = min(y*w,w*h-y*w)
ans = 0
if a==b:
  ans = 1
print(str(min(a,b))+" "+ str(ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict,deque, Counter
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
ans = 0


[W,H,x,y] = inpl()
ans1 = W*H/2.0
ans2 = 1 if (2*x-W)<eps and (2*y-H) <eps else 0

print(*[ans1,ans2])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def print_ans(W, H, x, y):
    """Test Case
    >>> print_ans(2, 3, 1, 2)
    3.000000 0
    >>> print_ans(2, 2, 1, 1)
    2.000000 1
    """
    area = float(W) * float(H) / 2
    whether = "1" if x == W // 2 and y == H // 2 else "0"
    print("{} {}".format(str(area), whether)) 

if __name__ == '__main__':
    W, H, x, y = map(int, input().rstrip().split())
    print_ans(W, H, x, y)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if y == (H/W)*x and x != 0 and y != 0:
    tf = 1
else:
    tf = 0
print(" ".join([str(W*H/2),str(tf)]))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if y == (H/W)*x:
    tf = 1
else:
    tf = 0
print(" ".join([str(W*H/2),str(tf)]))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if y == (H/W)*x:
    tf = 1
else:
    tf = 0
print(" ".join([str(W*H/float(2)),str(tf)]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
hor = min([W*y,W*H-W*y])
ver = min([H*x,W*H-H*x])
if y == (H/W*x) or y == H-(H/W*x):
    slash = W*H/2
else:
    slash = 0
tmp = [hor,ver,slash,W*H/2]
if len(list(set(tmp))) != 4:
    tf = 1
else:
    tf = 0
print(" ".join([str(W*H/2),str(tf)]))

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if W == H and x == y:
    tf = 1
else:
    tf = 0
hor = min([W*y,W*H-W*y])
ver = min([H*x,W*H-H*x])
if W == H and (x+y == W or x == y):
    slash = W*H/2
else:
    slash = 0
print(*[max([hor,ver,slash]),tf],sep = " ")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if W == H and x == y:
    tf = 1
else:
    tf = 0
hor = min([W*y,W*H-W*y])
ver = min([H*x,W*H-H*x])
if W == H and x+y == W:
    slash = W*H/2
else:
    slash = 0
print(*[max([hor,ver,slash]),tf],sep = " ")

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(float,input().split())
if W == H and x == y:
    tf = 1
else:
    tf = 0
hor = min([W*y,W*H-W*y])
ver = min([H*x,W*H-H*x])
print(*[max([hor,ver]),tf],sep = " ")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    sc = Scan()
    w, h, x, y = sc.intarr()
    flag = 0
    if w == 0 or h == 0:
        print('0 0')
        exit()
    if w//2 == x and h//2 == y:
        flag = 1
    s = w * h // 2
    print(s, flag)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Wrong Answer

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


def main():
    sc = Scan()
    w, h, x, y = sc.intarr()
    flag = 0
    if w == 0 or h == 0:
        print('0 0')
        exit()
    if w//2 == x and h//2 == y:
        flag = 1
    s = w * h / 2
    print(s, flag)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Wrong Answer

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


def main():
    sc = Scan()
    w, h, x, y = sc.intarr()
    flag = 0
    if w//2 == x and h//2 == y:
        flag = 1
    s = w * h / 2
    print(s, flag)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()

Submission status: Wrong Answer

Solution code:
W,H,X,Y=map(int,input().split())
if (( 2*X==W or 2*Y==H ) and (X!=Y)) or (X*H==Y*W):
  hantei =0
else:
  hantei =1
print(H*W/2,hantei)

Submission status: Wrong Answer

Solution code:
W,H,X,Y=map(int,input().split())
if ( 2*X==W or 2*Y==H ) and (X!=Y):
  hantei =0
else:
  hantei =1
print(H*W/2,hantei)

Submission status: Wrong Answer

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

if w > h:
    ans = min((h-y), y) * w
else:
    ans = min((w-x), x) * h

if w == h:
    f = 1
else:
    f = 0
    
print(ans,f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
midpoint = [w/2, h/2]

# def line(x1,y1,x2,y2):
#     inclination = (y1-y2)/(x1-x2)
#     section = y1 - inclination * x1
#     return inclination, section
#
# def return_x_area(inclination, section, h):
#     x1, y1 = -b/a, 0
#     x2, y2 = (h - section) / inclination, h
#     area =
#
# def return_y_area(inclination, section, w):
#     x1, y1 = 0, section
#     x2, y2 = w, inclination * w + section
#     return [x1, y1], [x2, y2]

if [x,y] == midpoint:
    print(str(w*h/2) + " 1")

elif x == midpoint[0]:
    print(str(w*h/2) + " 0")
else:
    print(str(w*h/2) + " 1")

    # inclination, section = line(x,y,midpoint[0],midpoint[1])
    # if section > 0　and section < 1:
    #     [x1, y1], [x2, y2] = return_y_coordinate(inclination, section, w)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
midpoint = [w/2, h/2]

def line(x1,y1,x2,y2):
    inclination = (y1-y2)/(x1-x2)
    section = y1 - inclination * x1
    return inclination, section
#
# def return_x_area(inclination, section, h):
#     x1, y1 = -b/a, 0
#     x2, y2 = (h - section) / inclination, h
#     area =
#
#
# def return_y_area(inclination, section, w):
#     x1, y1 = 0, section
#     x2, y2 = w, inclination * w + section
#     return [x1, y1], [x2, y2]

if [x,y] == midpoint:
    print(w*h/2, end ="")
    print(1)
elif x == midpoint[0]:
    print(w*h/2, end ="")
    print(0)
else:
    print(w*h/2, end ="")
    print(1)
    # inclination, section = line(x,y,midpoint[0],midpoint[1])
    # if section > 0　and section < 1:
    #     [x1, y1], [x2, y2] = return_y_coordinate(inclination, section, w)

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())
if x != W and x != 0 and y != 0 and y != H:
  print(str((H*W)/2) + " " + "0")
elif x == W/2 and y == H/2:
  print(str((H*W)/2) + " " + "1")
else:
  print(str((H*W)/2) + " " + "0")

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x == W/2 and y == H/2:
  print(str((W*H)/2) + " " + "1")
elif x == W/2 or y == H/2:
  print(str((H*W)/2) + " " + "0")
elif x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  elif a == b:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x == W/2 or y == H/2:
  print(str(max(a, b)) + " " + str(1)) 
elif x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  elif a == b:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x == W/2 and y == H/2:
  print(str(a) + " " + str(1)) 
elif x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  elif a == b:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x == W/2 and y == H/2:
  print(str(a) + " " + str(1))
elif x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  elif a == b:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  elif a == b:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = min(x*H, H*W-x*H)
b = min(y*W, H*W-y*W)
if x != 0 and x != W and y != 0 and y != H:
  if a > b:
    print(str(a) + " " + str(0))
  elif b > a:
    print(str(b) + " " + str(0))
  else:
    print(str(a) + " " + str(1))
else:
  print(str((H*W)/2) + " " + str(0))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
a = x*H
b = y*W
if a < b:
  print(str(a) + " " + str(0))
elif b < a:
  print(str(b) + " " + str(0))
else:
  print(str(a) + " " + str(1))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    W,H,x,y=map(int,input().split())
    S=W*H/2
    b=1 if x==W//2 and y==H//2 else 0
    print(str(S)+' '+str(b))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if min(x, W-x)*H == W*min(y, H-y):
  ans1 = min(x, W-x)*H
  ans2 = 1
elif min(x, W-x)*H > W*min(y, H-y):
  ans1 = min(x, W-x)*H
  ans2 = 0
else:
  ans1 = W*min(y, H-y)
  ans2 = 0

print('{} {}'.format(ans1, ans2))

Submission status: Wrong Answer

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

if min(x, W-x)*H == W*min(y, H-y):
  ans1 = min(x, W-x)*H
  ans2 = 1
elif min(x, W-x)*H > W*min(y, H-y):
  ans1 = min(x, W-x)*H
  ans2 = 0
else:
  ans1 = W*min(y, H-y)
  ans2 = 0

print('{} {}'.format(ans1, ans2))

Submission status: Wrong Answer

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

moto = w * h

wy = w * y
minY = min(wy, moto - wy)

hx = h * x
minX = min(hx, moto-hx)

if minX == minY:
    print(minY, "1")
else:
    print(max(minX,minY), "0")

Submission status: Wrong Answer

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

moto = w * h

wy = w * y
minY = min(wy, moto - wy)

hx = h * x
minX = min(hx, moto-hx)

if minX == minY:
    print(minY, 1)
else:
    print(max(minX,minY), 0)

Submission status: Wrong Answer

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


wh = w * h

wy = w * y
min1 = min(wy, wh - wy)

hx = h * x
min2 = min(hx, wh-hx)

if w == x or x == 0:
    print(min1, 0)
elif h == y or y == 0:
    print(min2, 0)
elif min1 == min2:
    print(min1, 1)
else:
    print(max(min1,min2), 0)

Submission status: Wrong Answer

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

wh = w * h

wy = w * y
min1 = min(wy, wh - wy)

hx = h * x
min2 = min(hx, wh-hx)

if w == x or x == 0:
    print(min1, 0)
elif h == y or y == 0:
    print(min2, 0)
elif min1 == min2:
    print(min1, 1)
else:
    print(max(min1,min2), 0)

Submission status: Wrong Answer

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

wh = w * h

wy = w * y
min1 = min(wy, wh - wy)

hx = h * x
min2 = min(hx, wh-hx)

if w == x or x == 0:
    print(min2, 0)
elif h == y or y == 0:
    print(min1, 0)
elif min1 == min2:
    print(min1, 1)
else:
    print(max(min1,min2), 0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=(w-x)*h
b=x*h
c=(h-y)*w
d=y*w

i=min(a,b)
j=min(c,d)
p=max(i,j)

if i>j and a==b:
  print(p,1)
elif i==j and (a==b or c==d):
  print(p,1)
elif i<j and c==d:
  print(p,1)
else:
  print(p,0)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=(w-x)*h
b=x*h
c=(h-y)*w
d=y*w

i=min(a,b)
j=min(c,d)
p=max(i,j)
fg=[]
fg.append(p)
if i>j and a==b:
  fg.append(1)
elif i==j and (a==b or c==d):
  fg.append(1)
elif i<j and c==d:
  fg.append(1)
else:
  fg.append(0)
print(fg)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
a=(w-x)*h
b=x*h
c=(h-y)*w
d=y*w

i=min(a,b)
j=min(c,d)
p=max(i,j)
if i>j and a==b:
  print(1)
elif i==j and (a==b or c==d):
  print(1)
elif i<j and c==d:
  print(1)
else:
  print(0)
print(p)

Submission status: Wrong Answer

Solution code:
H = list(map(int,input().split()))
h = H[0]
w = H[1]
x = H[2]
y = H[3]

if (h-2*x)*(w-2*y)!=0 or ((h-2*x==0) and (w-2*y==0)) and (x != h or x != 0 or y != 0 or y != w):
  a = 1
else:
  a = 0

print(h*w/2,a)

Submission status: Wrong Answer

Solution code:
H = list(map(int,input().split()))
h = H[0]
w = H[1]
x = H[2]
y = H[3]

if (h-2*x)*(w-2*y)!=0 or ((h-2*x==0) and (w-2*y==0)) and (x != h or y != w):
  a = 1
else:
  a = 0

print(h*w/2,a)

Submission status: Wrong Answer

Solution code:
H = list(map(int,input().split()))
h = H[0]
w = H[1]
x = H[2]
y = H[3]

if (h-2*x)*(w-2*y)!=0 or ((h-2*x==0) and (w-2*y==0)):
  a = 1
else:
  a = 0

print(h*w/2,a)

Submission status: Wrong Answer

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

MOD = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

MOD = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

MOD = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

MOD = 10 ** 9 + 7


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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

X = {W / 2, H / 2} & {x}
Y = {W / 2, H / 2} & {y}

print(W * H / 2, 0 if len(X) + len(Y) == 1 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 and y==h//2 else 0)

Submission status: Wrong Answer

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

print(W*H/2.0)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

gx=W/2
gy=H/2
S=W*H

if int(gx)==x or int(gy)==y:
  print(S/2,1)
else:
  print(S/2,0)

Submission status: Wrong Answer

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

gx=W/2
gy=H/2
S=W*H

if int(gx)==x and int(gy)==y:
  print(S/2,1)
else:
  print(S/2,0)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
S = w * h
vertical = min(x,w-x)
horizontal = min(y,h-y)
maxS = max(vertical/w,horizontal/h)*S
if vertical/w == horizontal/h:
    x = 1
else:
    x = 0
print(str(maxS)+" "+str(x))

Submission status: Wrong Answer

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

S = float(W*H*0.5)
num = "0"
if x == W//2 and y == H//2:
    num = "1"
    
print(S)
print(num)

Submission status: Wrong Answer

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

from decimal import *

getcontext().prec = 30
S = Decimal(str(W*H*0.5))

num = "0"
if x == W//2 and y == H//2:
    num = "1"
    
print(S, num)

Submission status: Wrong Answer

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

S = float(W*H*0.5)
num = "0"
if x == W//2 and y == H//2:
    num = "1"
    
print(format(S, "f"), num)

Submission status: Wrong Answer

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

S = float(W*H*0.5)
num = "0"
if x == W//2 and y == H//2:
    num = "1"
    
print(S, num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h/w*x == y:
    area = area / 2
elif h - h/w*x == y:
    area = area / 2
else:
    vert_split = (w-x) * h
    area_vert = min(area-vert_split, vert_split)
    hor_split = (h-y) * w
    area_hor = min(area-hor_split, hor_split)
    area = max(area_vert, area_hor)

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

Submission status: Wrong Answer

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

if h/w*x == y:
    area = area / 2
elif h - h/w*x == y:
    area = area / 2
else:
    vert_split = (w-x) * h
    area_vert = min(area-vert_split, vert_split)
    hor_split = (h-y) * w
    area_hor = min(area-hor_split, hor_split)
    area = max(area_vert, area_hor)

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

Submission status: Wrong Answer

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

vert_split = (w-x) * h
area_vert = min(area-vert_split, vert_split)
hor_split = (h-y) * w
area_hor = min(area-hor_split, hor_split)

print(max(area_vert, area_hor), 1 if (w // 2 == x) and (h // 2 == y) else 0)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf8 -*-

w,h,x,y = map(int, input().split())
rec = w * h
o = '0'
all = sorted([rec * (y / h), rec * (h - y)/ h, rec * (x / w), rec * (w - x)/ w], reverse = True)
for i, n in enumerate(all):
    if n <= rec / 2:
        tr = n
        c = all.count(n)
        if tr == rec / 2:
            if c >= 3:
                o = '1'
                break
        else:
            if c == 2:
                o = '1'
                break
ans = str(tr) + ' ' + o
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if(x == 0 or x == W or y == 0 or y == H):
	print(0, 0)
	exit(0)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print((W*H)/2, end=' ')

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

Submission status: Wrong Answer

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

print((W*H)/2, end=' ')

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

Submission status: Wrong Answer

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

size = 0
flag = 0

if W > x and H > y:
  if W > H:
    if y > H - y:
      size = (H-y)*W
    else:
      size = y*W
  else:
    if x > W - x:
      size = (W-x)*H
    else:
      size = x*H
  
    if W==H:
      flag=1
  
  print(str(size) + " " + str(flag))
elif W == x:
  if y > H - y:
    size = (H-y)*W
  else:
    size = y*W
  print(str(size) + " " + str(0))
    
elif H == y:
  if x > W - x:
    size = (W-x)*H
  else:
    size = x*H
  print(str(size) + " " + str(0))

Submission status: Wrong Answer

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

print((W*H)/2, end=' ')

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

Submission status: Wrong Answer

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

size = 0
flag = 0

if W < x and H < y:
  if W > H:
    if y > H - y:
      size = (H-y)*W
    else:
      size = y*W
  else:
    if x > W - x:
      size = (W-x)*H
    else:
      size = x*H
  
    if W==H:
      flag=1
elif W == x:
  if y > H - y:
    size = (H-y)*W
  else:
    size = y*W
    
elif H == y:
  if x > W - x:
    size = (W-x)*H
  else:
    size = x*H
  

  
print(str(size) + " " + str(flag))

Submission status: Wrong Answer

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

print((W*H)/2, end=' ')

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

Submission status: Wrong Answer

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

print((W*H)/2, end=' ')

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

Submission status: Wrong Answer

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

print(W*H/2, end=' ')

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

Submission status: Wrong Answer

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

size = 0
flag = 0

if W > H:
  if y > H - y:
    size = (H-y)*W
  else:
    size = y*W
else:
  if x > W - x:
    size = (W-x)*H
  else:
    size = x*H
  
  if W==H:
    flag=1
print(str(size) + " " + str(flag))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
split_x=H*min(x,W-x)
split_y=W*min(y,H-y)
print(max(split_x, split_y),1) if split_x==split_y else print(max(split_x, split_y),0)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
xmin = min(x*H,(W-x)*H)
ymin = min(W*y,(W-y)*H)
print("{} {}".format(max(xmin,ymin),int(xmin==ymin)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 0

#y軸方向に切るとき
if x == 0 or x == W:
    S_y = 0
else:
    S_y1 = x * H
    S_y2 = (W-x) * H
    S_y = min(S_y1, S_y2)

#x軸方向に切るとき

if y == 0 or y == H:
    S_x = 0
else:
    S_x1 = y * W
    S_x2 = (H-y) * W
    S_x = min(S_x1, S_x2)


if S_y == S_x:
    count += 1

print(str(max(S_x, S_y)) + " " + str(count))

Submission status: Wrong Answer

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

count = 0

#y軸方向に切るとき
S_y1 = x * H
S_y2 = (W-x) * H
S_y = min(S_y1, S_y2)

#x軸方向に切るとき
S_x1 = y * W
S_x2 = (H-y) * W
S_x = min(S_x1, S_x2)

if S_y == S_x:
    count += 1

print(str(max(S_x, S_y)) + " " + str(count))

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)