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:
def main():
    W, H, x, y = map(float, input().split())
    area = 0
    p = 0
    V1 = (W-x) * H
    V2 = x * H
    H1 = (H-y) * W
    H2 = y * W
    if x == W or y == H or x == 0 or y == 0:
        p = 0
        if x == W:
            area = min(H1, H2)
        elif y == H:
            area = min(V1, V2)
        elif (x == W and y == H) or (x == 0 and y == 0) or (x == W and y == 0) or (x == 0 and y ==H):
            area = 0 

        print(format(area, '.6f'), p)
        exit(0)

    elif min(V1, V2) == min (H1, H2):
        p = 1
        area = min(V1, V2)
    else :
        p = 0
        area = max(min(V1, V2), min(H1,H2))
    print(format(area, '.6f'), p)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    W, H, x, y = map(float, input().split())
    area = 0
    p = 0
    V1 = (W-x) * H
    V2 = x * H
    H1 = (H-y) * W
    H2 = y * W
    if x == W or y == H or x == 0 or y == 0:
        p = 0
        if x == W:
            area = min(H1, H2)
        elif y == H:
            area = min(V1, V2)
        elif x == W and y == H:
            area = 0 
        print(format(area, '.6f'), p)
        exit(0)

    elif min(V1, V2) == min (H1, H2):
        p = 1
        area = min(V1, V2)
    else :
        p = 0
        area = max(min(V1, V2), min(H1,H2))
    print(format(area, '.6f'), p)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    W, H, x, y = map(float, input().split())
    area = 0
    p = 0
    V1 = (W-x) * H
    V2 = x * H
    H1 = (H-y) * W
    H2 = y * W
    if x == W or y == H or x == 0 or y == 0:
        p = 0
        if x == W:
            area = min(H1, H2)
        elif y == H:
            area = min(V1, V2)
        exit(0)

    elif min(V1, V2) == min (H1, H2):
        p = 1
        area = min(V1, V2)
    else :
        p = 0
        area = max(min(V1, V2), min(H1,H2))
    print(format(area, '.6f'), p)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(w*h/2,1)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(float, input().split())
if (abs(w//2-x)>abs(h//2-y)):
    print("{:.6f} {}".format(min(y*w,(h-y)*w),0))
elif (abs(w//2-x)<abs(h//2-y)):
    print("{:.6f} {}".format(min(x*h,(w-x)*h),0))
else:
    print("{:.6f} {}".format(min(x*h,(w-x)*h),1))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inputNum = list(map(int, input().split()))

W = inputNum[0]
H = inputNum[1]
x = inputNum[2]
y = inputNum[3]

maxValue = W * H / 2.000000
checkFlag = 1

if (x*2 == W):
    checkFlag = 0
    if (y*2 == H):
        checkFlag = 1

if (y*2 == H):
    checkFlag = 0
    if (x*2 == W):
        checkFlag = 1

print('{:.6f}'.format(maxValue), checkFlag)

Submission status: Wrong Answer

Solution code:
inputNum = list(map(int, input().split()))

W = inputNum[0]
H = inputNum[1]
x = inputNum[2]
y = inputNum[3]

maxValue = W * H / 2.000000
checkFlag = 1

if (x*2 == W):
    checkFlag = 0
    if (y*2 == W):
        checkFlag = 1

if (y*2 == W):
    checkFlag = 0
    if (x*2 == W):
        checkFlag = 1

print('{:.6f}'.format(maxValue), checkFlag)

Submission status: Wrong Answer

Solution code:
inputNum = list(map(int, input().split()))

W = inputNum[0]
H = inputNum[1]
x = inputNum[2]
y = inputNum[3]

maxValue = W * H / 2.000000
checkFlag = 1

if (x*2 == W):
    checkFlag = 0
    if (y*2 == H):
        checkFlag = 1

print('{:.6f}'.format(maxValue), checkFlag)

Submission status: Wrong Answer

Solution code:
w, h, x, y = list(map(int, input().split(' ')))
a = 0
b = 0
if w != x and h != y:
    if w/2 < x:
        a = w-x
    else:
        a = x
    if h/2 < y:
        b = h-y
    else:
        b = y

    if a*h > b*w:
        print(a*h, 0)
    elif b*w > a*h:
        print(b*w, 0)
    else:
        print(b*w, 1)
elif w == x:
    print(y*w, 0)
elif h == y:
    print(x*h, 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, 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=[int(i) for i in input().split()]
hori = min(w*y,(h-y)*w)
ver = min(h*w,(w-x)*h)

print(max(hori,ver),end=' ')
if(hori==ver):
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if ((x - W) / 2.0) < eps and ((y - H) / 2.0) < eps:
    flag = 1
else:
    flag = 0

print(max_area, flag)

Submission status: Wrong Answer

Solution code:
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if x - W / 2.0 < eps and y - H / 2.0 < eps:
    flag = 0
else:
    flag = 0

print(max_area, flag)

Submission status: Wrong Answer

Solution code:
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if x - W / 2.0 < eps and y - H / 2.0 < eps:
    flag = 1
else:
    flag = 0

print(max_area, flag)

Submission status: Wrong Answer

Solution code:
from copy import *
from sys import *
import math
import queue
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)

#s[i] is linked with t[len(s)-i-1]
def main():
	a,b,c,d = map(int,input().split())
	i = 1 if a//2 == c  and b//2 == d else 0
	print('{} {}'.format(a*b/2,i))


def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
count = 0
ans = (W * H) / 2
tmp = ans
while tmp % 2 == 0:
    count += 1
    tmp /= 2

print(ans,count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,a,b = map(int,input().split())
S = (W+H)/2
print(S,1)

Submission status: Wrong Answer

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

s11 = x*H 
s12 = (W-x)*H
S1 = min(s11,s12)

s21 = y*W
s22 = (H-y)*W
S2 = min(s21,s22)

S = max(S1,S2)
print(S,judge)

Submission status: Wrong Answer

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

s11 = x*H 
s12 = (W-x)*H
S1 = min(s11,s12)

s21 = y*W
s22 = (H-y)*W
S2 = min(s21,s22)

if((x!=0)and(W!=0)):
 if(y/x == H/W): 
   judge = 1  
  
if(S1 == S2): 
  judge = 1 
  print(S1,judge)
elif(S1 < S2): 
  print(S2,judge)
elif(S1 > S2): 
  print(S1,judge)

Submission status: Wrong Answer

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

s11 = x*H 
s12 = (W-x)*H
S1 = min(s11,s12)

s21 = y*W
s22 = (H-y)*W
S2 = min(s21,s22)

if(S1 == S2): print(S1,1)
elif(S1 < S2): print(S2,0)
elif(S1 > S2): print(S1,0)

Submission status: Wrong Answer

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


if w//2 == x: 
    answer = (w*h)/2
else:
    answer = ((w-x)*h)/2
if w==h:
    j = 1
else:
    j = 0
    
k = ('{:.6f}'.format(answer))    

print(k,j)

Submission status: Wrong Answer

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

answer = (w*h)/2

if w==h:
    j = 1
else:
    j = 0
    
k = ('{:.6f}'.format(answer))    

print(k,j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

W, H, x, y = LI()

'''
どこの点が与えられても、縦、横、四隅の点とむすんで面積を確認する
対角で面積が同じ場合は、2分割を意味する
正方形の場合、絶対半分にでき、原点の場合は複数個線を作れる

長方形の場合、原点の場合は複数個可能で、それ以外の場合は無理
'''

if W == H:
    # 正方形の場合
    print(W*H/2, end=' ')
    if x == y == W/2:
        print(1)
    else:
        print(0)
else:
    # 正方形以外の場合
    if x == W/2 and y == H/2:
        print(W*H/2, 1)
    else:
        # 中途半端な位置の点のばあい
        # 4隅と縦横を調査
        S = W*H
        # 縦の場合
        s1 = x*H
        s2 = S - s1
        sm = min(s1, s2)

        # 横の場合
        s1 = W*y
        s2 = S - s1
        sm = max(sm, min(s1, s2))
        print(sm, 0)

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)

W, H, x, y = LI()

'''
どこの点が与えられても、縦、横、四隅の点とむすんで面積を確認する
対角で面積が同じ場合は、2分割を意味する
正方形の場合、絶対半分にでき、原点の場合は複数個線を作れる

長方形の場合、原点の場合は複数個可能で、それ以外の場合は無理
'''

if W == H:
    # 正方形の場合
    print(W, end=' ')
    if x == y == W/2:
        print(1)
    else:
        print(0)
else:
    # 正方形以外の場合
    if x == W/2 and y == H/2:
        print(W*H/2, 1)
    else:
        # 中途半端な位置の点のばあい
        # 4隅と縦横を調査
        S = W*H
        # 縦の場合
        s1 = x*H
        s2 = S - s1
        sm = min(s1, s2)

        # 横の場合
        s1 = W*y
        s2 = S - s1
        sm = max(sm, min(s1, s2))
        print(sm, 0)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
r=(0<c<a)&(0<d<b)&~((a==c*2)^(b==d*2))
print(a*b/2.0,r)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
print(a*b/2.0,int(((c*2!=a)&(0<c<a))&((d*2!=b)& (0<d<b))))

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
print(a*b/2.0,int((0<c<a)&(0<d<b)))

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
print(a*b/2.0,int(0<c<a&0<d<b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
w,h,x,y=(map(int,input().split()))
xeven=(w%2==0)
yeven=(h%2==0)

if(xeven and yeven):
	if(x==w//2 and y==w//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())

ans = [min(x, W - x) * H, min(y, H - y) * W]

if x == H / 2 and y == W / 2:
    print(W * H / 2, 1)
elif (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)
else:
    print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

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

ans = [min(x, W - x) * H, min(y, H - y) * W]

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)
else:
    print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

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

ans = [min(x, W - x) * H, min(y, H - y) * W]

if (x == 0 and y == 0) or (x == 1 and y == 0) or (x == 0 and y == 1) or (x == 1 and y == 1):
    print(W * H / 2, 0)
else:
    print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

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

ans = [min(x, W - x) * H, min(y, H - y) * W]

if (W == 0 and H == 0) or (W == 1 and H == 0) or (W == 0 and H == 1) or (W == 1 and H == 1):
    print(W * H / 2, 0)
else:
    print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

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

ans = [min(x, W - x) * H, min(y, H - y) * W]

if (W == 0 and H == 0) or (W == 1 and H == 0) or (W == 0 and H == 1) or (W == 1 and H == 1):
    print(W * H / 2, 1)
else:
    print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

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

ans = [min(x, W - x) * H, min(y, H - y) * W]
print(max(ans), int(ans[0] == ans[1]))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if c == a / 2 and d == b / 2:
  ans = 1
else:
  ans = 0
e = a * b  
print("{} {}".format(e, ans))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if c == a / 2 and d == b / 2:
  ans = 0
else:
  ans = 1
e = a * b  
print("{} {}".format(e, ans))

Submission status: Wrong Answer

Solution code:
def main16():
    data = input().split()
    num = []
    for i in range(4):
        num.append(int(data[i]))
    men = int(num[0]*num[1]/2)
    huku = 0
    if num[0] == num[2]*2 and [1] == num[3]*2:
        huku = 1
    print(men,huku)

if __name__ == "__main__":
    main16()

Submission status: Wrong Answer

Solution code:
def main16():
    data = input().split()
    num = []
    for i in range(4):
        num.append(int(data[i]))
    men = int(num[0]*num[1]/2)
    huku = 0
    if num[0]%2 == 0 and num[1]%2 == 0:
        if int(num[0]/2) == num[2] and int(num[1]/2) == num[3]:
            huku = 1
    print(men,huku)

if __name__ == "__main__":
    main16()

Submission status: Wrong Answer

Solution code:
X, Y, x, y =map(int, input().split())

h=[x*Y, (X-x)*Y]
w=[y*X, (Y-y)*X]

p=[min(h),min(w)]

if p[0]==p[1]:
    print(max(p), 1)
else:
    print(max(p), 0)

Submission status: Wrong Answer

Solution code:
n1, n2, n3, n4 = [int(i) for i in input().split()]

n5 = (n1 * n2) / 2

n6 = max((min(n1 - n3, n3) * n2, min(n2 - n4, n4) * n1))

n7 = max(n1 - n3, n3)
n8 = max(n2 - n4, n4)

if n3 == 0:
    n9 = (max((n2 - n4), n4) * n1) / 2
elif n4 == 0:
    n9 = max((n1 - n3), n3) * n2
elif (n8 * n1) / n7 >= n2:
    n9 = (((n7 * n2) / n8) * n1) / 2
else:
    n9 = (((n8 * n1) / n7) * n2) / 2

n6 = max(n6, n9)

if (n1 - n3) == n3 and (n2 - n4) == n4:
    s10 = " 1"
else:
    s10 = " 0"

print(str(n6) + s10)

Submission status: Wrong Answer

Solution code:

n1, n2, n3, n4 = [int(i) for i in input().split()]

n5 = (n1 * n2) / 2

n6 = max((min(n1 - n3, n3) * n2, min(n2 - n4, n4) * n1))

n7 = max(n1 - n3, n3)
n8 = max(n2 - n4, n4)

if n3 == 0:
    n9 = (max((n2 - n4), n4) * n1) / 2
elif n4 == 0:
    n9 = max((n1 - n3), n3) * n2
elif (n4 * n1) / n7 >= n2:
    n9 = (((n7 * n2) / n8) * n1) / 2
else:
    n9 = (((n8 * n1) / n7) * n2) / 2

n6 = max(n6, n9)

if (n1 - n3) == n3 and (n2 - n4) == n4:
    s10 = " 1"
else:
    s10 = " 0"

print(str(n6) + s10)

Submission status: Wrong Answer

Solution code:
n1, n2, n3, n4 = [int(i) for i in input().split()]

n5 = (n1 * n2) / 2

n6 = max((min(n1 - n3, n3) * n2, min(n2 - n4, n4) * n1))

if n3 == 0:
    n9 = (max((n2 - n4), n4) * n1) / 2
elif n4 == 0:
    n9 = (max((n1 - n3), n3) * n2) / 2
elif (n4 * n1) / n3 >= n2:
    n9 = (((n3 * n2) / n4) * n1) / 2
else:
    n9 = (((n4 * n1) / n3) * n2) / 2

n6 = max(n6, n9)

if (n1 - n3) == n3 and (n2 - n4) == n4:
    s10 = " 1"
else:
    s10 = " 0"

print(str(n6) + s10)

Submission status: Wrong Answer

Solution code:
n1, n2, n3, n4 = [int(i) for i in input().split()]

n5 = (n1 * n2) / 2

n6 = max((min(n1 - n3, n3) * n2, min(n2 - n4, n4) * n1))

n7 = max(n1 - n3, n3)
n8 = max(n2 - n4, n4)

if n3 == 0:
    n9 = max((n2 - n4), n4) * n1
elif n4 == 0:
    n9 = max((n1 - n3), n3) * n2
elif (n4 * n1) / n3 >= n2:
    n9 = (((n3 * n2) / n4) * n1) / 2
else:
    n9 = (((n4 * n1) / n3) * n2) / 2

n6 = max(n6, n9)

if (n1 - n3) == n3 and (n2 - n4) == n4:
    s10 = " 1"
else:
    s10 = " 0"

print(str(n6) + s10)

Submission status: Wrong Answer

Solution code:
n1, n2, n3, n4 = [int(i) for i in input().split()]

n5 = (n1 * n2) / 2

n6 = max((min(n1 - n3, n3) * n2, min(n2 - n4, n4) * n1))

n7 = max(n1 - n3, n3)
n8 = max(n2 - n4, n4)

if n3 == 0:
    n9 = (n2 - n4) * n1
elif n4 == 0:
    n9 = (n1 - n3) * n2
elif (n4 * n1) / n3 >= n2:
    n9 = (((n3 * n2) / n4) * n1) / 2
else:
    n9 = (((n4 * n1) / n3) * n2) / 2

n6 = max(n6, n9)

if (n1 - n3) == n3 and (n2 - n4) == n4:
    s10 = " 1"
else:
    s10 = " 0"

print(str(n6) + s10)

Submission status: Wrong Answer

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

minx = min(x*H,(W-x)*H)
miny = min(W*y,W*(H-y))
if minx == miny:
    print(minx,1)
else:
    print(max(minx,miny),0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

minw = min(x, w-x)
minh = min(y, h-y)
if w-x == x and y == h - y:
    mul = "1"
else:
    mul = "0"
print max(minw*h, minh*w), mul

Submission status: Wrong Answer

Solution code:
W, H, x, y = tuple([int(s) for s in input().split()])
S = W * H / 2
flag = 1 if (W // 2 == x and H // 2 == y) else 0
print("{0} {1}".format(S, flag))

Submission status: Wrong Answer

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

if x == W/2 or y == H/2:
    flag = 1
    
print(str(W*H/2) + ' ' +str(flag))

Submission status: Wrong Answer

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

w = min(x, W - x)
s1 = w * H
h = min(y, H - y)
s2 = W * h
ans = max(s1, s2)
eq = 1 if s1 == s2 else 0


print(ans, eq)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
c = 0
# y=ax+b
try:
    a = (2*x-W)/(2*y-H)
    b = (W-H*a)/2
except ZeroDivisionError:
    c=c
else:
    c+=1
try:
    a = (2*y-H)/(2*x-W)
    b = (H-W*a)/2
except ZeroDivisionError:
    c=c
else:
    c+=1
c = 1 if c>=2 else 0
print(W*H/2,c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x == 0 or x == W or x == int(W/2) or y == 0 or y == H or y == int(H/2):
  print('%f %i', W*H/2, 0)
else:
  print('%f %i', W*H/2, 1)

Submission status: Wrong Answer

Solution code:
w, h, x, y = (int(i) for i in input().split())
S = float(w * h / 2)
a = 0
if w//2 == x and h//2 == y:
  a = 1
print(S,a)

Submission status: Wrong Answer

Solution code:
w, h, x, y = (int(i) for i in input().split())
S = w * h / 2
a = 0
if w//2 == x and h//2 == y:
  a = 1
print(S, a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min_max_area = w*h/2
num = 1 if x == int(w/2) and y == int(h/2) else 0
print("{} {}".format(min_max_area, num))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int,input().split())
hantei = 0
if (x != 0) and (y != 0):
    if (W%x == 0):
        if y*(W/x) == H:
            hantei = 1
print("{0} {1}".format(W*H/2, hantei))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    a1 = W * y
    b1 = W * H - a1
    ans1 = min(a1, b1)

    a2 = H * x
    b2 = W * H - a2
    ans2 = min(a2, b2)

    if (x, y) in [(0, 0), (W, H), (W, 0), (0, H)]:
        print(0, 1)
    elif ans1 == ans2:
        print(ans1, 1)
    else:
        print(max(ans1, ans2), 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    a1 = W * y
    b1 = W * H - a1
    ans1 = min(a1, b1)

    a2 = H * x
    b2 = W * H - a2
    ans2 = min(a2, b2)

    if (x, y) in [(0, 0), (W, H), (W, 0), (0, H)]:
        print(0, 0)
    elif ans1 == ans2:
        print(ans1, 1)
    else:
        print(max(ans1, ans2), 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

    a1 = W * y
    b1 = W * H - a1
    ans1 = min(a1, b1)

    a2 = H * x
    b2 = W * H - a2
    ans2 = min(a2, b2)

    if ans1 == ans2:
        print(ans1, 1)
    else:
        print(max(ans1, ans2), 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

area1 = (w - x) * h
area2 = w * (h - y)

if w == x:
    print(min(area2, w * h -area2) , 0)
elif h == y:
    print(min(area1, w * h -area1) , 0)
else:
    ans = max (min(area1, w * h -area1) , min(area2, w*h-area2))
    tf = 0
    if area1 == area2 or area1 == w * h -area2:
        tf = 1
    print(ans, tf)

Submission status: Wrong Answer

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

area1 = (w - x) * h
area2 = w * (h - y)

ans = max (min(area1, w * h -area1) , min(area2, w*h-area2))

tf = 1
if area1 == area2 or area1 == w * h -area2:
    tf = 0

print(ans, tf)

Submission status: Wrong Answer

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

area1 = (w - x) * h
area2 = w * (h - y)

ans = max (min(area1, w * h -area1) , min(area2, w*h-area2))

tf = 0
if area1 == area2 or area1 == w * h -area2:
    tf = 1

print(ans, tf)

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
s = w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))
print(str(s) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
s = w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))
if r_x == 0.5 and r_y ==0.5:
    print(str(s) + " 1")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
s = w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))
print(str(s) + " 1")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
s = w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))

if abs(min(r_x, 1-r_x) - min(r_y, 1-r_y)) < 1e-20:
    print(str(s) + " 1")
else:
    print(str(s) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h
s = w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))

if abs(min(r_x, 1-r_x) - min(r_y, 1-r_y)) < 1e-10:
    print(str(s) + " 1")
else:
    print(str(s) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h

if abs(abs(0.5-r_x) - abs(0.5-r_y)) < 1e-15:
    print(str(w*h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h

if abs(abs(0.5-r_x) - abs(0.5-r_y)) < 1e-8:
    print(str(w*h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h

if abs(abs(0.5-r_x) - abs(0.5-r_y)) < 1e-10:
    print(str(w*h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h

if abs(abs(0.5-r_x) - abs(0.5-r_y)) < 1e-10:
    print(str(w*h/2) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")

Submission status: Wrong Answer

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

r_x = x / w
r_y = y / h

if abs(0.5-r_x) - abs(0.5-r_y) < 1e-10:
    print(str(w*h/2) + " 1")
else:
    print(str(w * h * max(min(r_x, 1-r_x), min(r_y, 1-r_y))) + " 0")