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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    w, h, x, y = map(int, readline().split())
    a = min(h*x, h*(w-x))
    b = min(w*y, w*(h-y))
    c = (w*h)/2
    if ((x, y) == (0, 0)) or ((x, y) == (w, 0)) or ((x, y) == (w, h)) or ((x, y) == (0, h)):
        print('{:.10f} 0'.format(c))
        return
    print('{:.10f}'.format(max(a, b)), end=' ')
    print(1) if a == b else print(0)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    w, h, x, y = map(int, readline().split())
    a = min(h*x, h*(w-x))
    b = min(w*y, w*(h-y))
    print('{:.10f}'.format(max(a, b)), end=' ')
    print(1) if a == b else print(0)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

s1 = min((w-x)*h, x*h)
s2 = min(w*y, w*(h-y))

if s1 == s2:
    print(s1, 1)
else:
    print(max(s1, s2), 0)

Submission status: Wrong Answer

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

area_x1 = x * H
area_x2 = (W-x) * H
if area_x1 != 0 and area_x2 != 0:
    area_x = min(area_x1, area_x2)
else:
    area_x = max(area_x1, area_x2)

area_y1 = W * y
area_y2 = W * (H-y)
if area_y1 != 0 and area_y2 != 0:
    area_y = min(area_y1, area_y2)
else:
    area_y = max(area_y1, area_y2)

ans1 = max(area_x, area_y)
if W/2 == x and H/2 == y:
    ans2 = 1
else:
    ans2 = 0
print(ans1, ans2)

Submission status: Wrong Answer

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

area_x1 = x * H
area_x2 = (W-x) * H
area_x = min(area_x1, area_x2)
area_y1 = W * y
area_y2 = W * (H-y)
area_y = min(area_y1, area_y2)
ans1 = max(area_x, area_y)

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

Submission status: Wrong Answer

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

menseki = W*H
mensekix = min(x, W-x) * H
mensekiy = W * min(y, H-y)
ans1 = max(mensekix, mensekiy)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

w, h, x, y = list(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 / 2:
    A = x * H
else:
    A = (W - x) * H

if y < H / 2:
    B = y * W
else:
    B = (H - y) * W
print(min(A, B))
if A == B:
    print(1)
else:
    print(0)

Submission status: Wrong Answer

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

print('{:.9f}'.format(W*H/2), can)

Submission status: Wrong Answer

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

print('{:.9f}'.format(W*H/2), can)

Submission status: Wrong Answer

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

print('{:.9f}'.format(W*H/2),0)

Submission status: Wrong Answer

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

print('{:.9f}'.format(W*H/2), 1)

Submission status: Wrong Answer

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

print('{:.9f}'.format(W*H/2), can)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
W, H, x, y = map(int, input().split())
tmp = 0

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

    print('{:f}'.format((H*W)/2), 0)
    exit()

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
W, H, x, y = map(int, input().split())
tmp = 0

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

    print('{:f}'.format((H*W)//2), 0)
    exit()

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
W, H, x, y = map(int, input().split())
tmp = 0

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

    print('{:f}'.format((H*W)/2), 0)
    exit()

Submission status: Wrong Answer

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
W, H, x, y = map(int, input().split())
tmp = 0
maxx = 0
if W // 2 == x and H // 2 == y:
    tmp = (W*(H-1))
    print('{:f}'.format(tmp), 1)
    exit()
else:
    maxx = max((H-y)*x, (W-x)*H)
    print('{:f}'.format(maxx), 0)
    exit()

Submission status: Wrong Answer

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    W, H, x, y = readnums()
    ans = max(min(H * x, (W - x) * H), min(W * y, W * (H - y)))
    if min(H * x, (W - x) * H) == min(W * y, W * (H - y)):
        print(ans, 1)
    else:
        print(ans, 0)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
all = W * H
a = min(x*H,(W-x)*H)
b = min(y*W,(H-y)*W)

if x == W//2 and y == H//2:
    print(all/2,1)
else:
    print(max(a,b),0)

Submission status: Wrong Answer

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

print(max(ans1, ans2), bo)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
menseki1 = min(w - x, x) * h
menseki2 = min(h - y, y) * w
hantei = menseki1 == menseki2
print(max(menseki1, menseki2), int(hantei))

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    w, h, x, y = map(int, input().split())
    area = 0
    if x not in [0, w]:
        area = max(area, min(h * x, w * h - h * x))
    if y not in [0, h]:
        area = max(area, min(y * w, w * h - y * w))
    print(area, end=" ")
    print(1 if 2 * x == w and 2 * y == h else 0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if W // 2 == x and H // 2 == y and (x != 0 and y != 0):
    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 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())
ans1 = min(x, w - x) * h
ans2 = min(y, h - y) * w
bo = 0
if ans1 == ans2:
    bo = 1

print(max(ans1, ans2), bo)

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

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:
a,b,c,d=map(int,input().split())

print(a*b/2)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
area1 = W*y
area2 = H*x
print(area1 if area1 < area2 else area2, end='')
print(' 1' if W == H else ' 0')

Submission status: Wrong Answer

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

#r=[[] for ii in range(2)]
r=[0]*6
r[0]=min([x*h,(w-x)*h])
r[1]=min([y*w,(h-y)*w])
if x>0 and y>0:
  r[2]=min([h**2*x/y/2,w**2*y/x/2])
if w-x>0 and y>0:
  r[3]=min([h**2*(w-x)/y/2,w**2*y/(w-x)/2])
if x>0 and h-y>0:
  r[4]=min([h**2*x/(h-y)/2,w**2*(h-y)/x/2])
if w-x>0 and h-y>0:
  r[5]=min([h**2*(w-x)/(h-y)/2,w**2*(h-y)/(w-x)/2])
#print(r)
r.sort(reverse=True)
#print(r)
if r[0]-r[1]==0:
  n=1
else:
  n=0
print(r[0],n)

Submission status: Wrong Answer

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

#r=[[] for ii in range(2)]
r=[0]*6
r[0]=min([x*h,(w-x)*h])
r[1]=min([y*w,(h-y)*w])
if x>0 and y>0:
  r[2]=min([h**2*x/y/2,w**2*y/x/2])
if w-x>0 and y>0:
  r[3]=min([h**2*(w-x)/y/2,(w-x)**2*y/(w-x)/2])
if x>0 and h-y>0:
  r[4]=min([(h-y)**2*x/(h-y)/2,w**2*(h-y)/x/2])
if w-x>0 and h-y>0:
  r[5]=min([(h-y)**2*(w-x)/(h-y)/2,(w-x)**2*(h-y)/(w-x)/2])
#print(r)
r.sort(reverse=True)
#print(r)
if r.count(r[0])>1:
  n=1
else:
  n=0
print(r[0],n)

Submission status: Wrong Answer

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

#r=[[] for ii in range(2)]
r=[0]*6
r[0]=min([x*h,(w-x)*h])
r[1]=min([y*w,(h-y)*w])
if x>0 and y>0:
  r[2]=min([h**2*x/y/2,w**2*y/x/2])
if w-x>0 and y>0:
  r[3]=min([h**2*(w-x)/y/2,w**2*y/(w-x)/2])
if x>0 and h-y>0:
  r[4]=min([h**2*x/(h-y)/2,w**2*(h-y)/x/2])
if w-x>0 and h-y>0:
  r[5]=min([h**2*(w-x)/(h-y)/2,w**2*(h-y)/(w-x)/2])
#print(r)
r.sort(reverse=True)
#print(r)
if r.count(r[0])>1:
  n=1
else:
  n=0
print(r[0],n)

Submission status: Wrong Answer

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

r=[[] for ii in range(2)]
r[0]=sorted([x*h,(w-x)*h])
r[1]=sorted([y*w,(h-y)*w])
r.sort(reverse=True)
#print(r)
if r[0][0]==r[1][0]:
  n=1
else:
  n=0
print(r[0][0],n)

Submission status: Wrong Answer

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

r=[[] for ii in range(2)]
r[0]=sorted([x*h,(w-x)*h])
r[1]=sorted([y*w,(h-y)*w])
r.sort(reverse=True)
#print(r)
if r[0][0]==r[1][0]:
  n=1
else:
  n=0
print(r[0][0],n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = [int(x) for x in 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 in {0, W} or y in {0, H}:
    print(W * H / 2, 0)
elif W / 2 == x and H / 2 == y:
    print(W * H / 2, 1)
elif W / 2 == x or H / 2 == y:
    print(W * H / 2, 0)
else:
    x1 = x
    x2 = W - x

    y1 = y
    y2 = H - y

    r1 = x1 * H
    r2 = x2 * H
    r3 = y1 * W
    r4 = y2 * W

    r12 = min(r1, r2)
    r34 = min(r3, r4)

    n = 0
    if r12 == r34:
        n = 1

    print(max(r12, r34), n)

Submission status: Wrong Answer

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

if x in {0, W} or y in {0, H}:
    print(W * H / 2, 0)
else:
    x1 = x
    x2 = W - x

    y1 = y
    y2 = H - y

    r1 = x1 * H
    r2 = x2 * H
    r3 = y1 * W
    r4 = y2 * W

    r12 = min(r1, r2)
    r34 = min(r3, r4)

    n = 0
    if r12 == r34:
        n = 1

    print(max(r12, r34), n)

Submission status: Wrong Answer

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

x1 = x
x2 = W - x

y1 = y
y2 = H - y

r1 = x1 * H
r2 = x2 * H
r3 = y1 * W
r4 = y2 * W

r12 = min(r1, r2)
r34 = min(r3, r4)

n = 0
if r12 == r34:
    n = 1

print(max(r12, r34), n)

Submission status: Wrong Answer

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

    area = 0
    pat = 0

    if y == x or y == -(H/W) * (x - W):
        area = (W*H)/2.0
        pat = 0

    else:
        area_H = 0
        area_V = 0

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

        if area_H == area_V:
            pat = 1

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    area = 0
    pat = 0

    if (x == 0 and y == 0) or (x == 0 and y == H) or (x == W and y == 0) or (x == W and y == H):
        area = (W*H)/2.0
        pat = 0

    else:
        area_H = 0
        area_V = 0

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

        if area_H == area_V:
            pat = 1

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    area = 0
    pat = 0

    if (x == 0 and y == 0) or (x == 0 and y == H) or (x == W and y == 0) or (x == W and y == H) or y == x:
        area = (W*H)/2.0
        pat = 0

    else:
        area_H = 0
        area_V = 0

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

        if area_H == area_V:
            pat = 1

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    area = 0
    pat = 0

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

    else:
        area_H = 0
        area_V = 0

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

        if area_H == area_V:
            pat = 1

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import numpy as np
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))


w,h,x,y=input_list()
ans=w*h/2
mul=0
if w//2==x and h//2==y:
    mul=1

print(ans,mul)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
import math
import fractions
import functools
import copy

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

area = w*h
ans = max(min(x*h,area-x*h),min(y*h,area-y*w))
ans0 = (1 if x*h==y*w else 0)
print(ans,ans0)

Submission status: Wrong Answer

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

ans = min(x*h,y,w)
ans0 = (1 if x*h==y*w else 0)
print(ans,ans0)

Submission status: Wrong Answer

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

ans = max(x*h,y,w)
ans0 = (1 if x*h==y*w else 0)
print(ans,ans0)

Submission status: Wrong Answer

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

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

left = x * h
right = (w - x)*h
tatemin = min(left,right)

under = w * y
top = w * (h - y)
yokomin = min(under,top)

bigger = max(tatemin,yokomin)

if tatemin == yokomin:
    print(bigger,1)
else:
    print(bigger,0)

Submission status: Wrong Answer

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

left = x * h
right = (w - x)*h
under = w * y
top = w * (h - y)
arr = [left,right,under,top]
arr.sort()
if arr[0]==arr[1]:
    print(arr[1],1)
else:
    print(arr[1],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:
if W==H*2 and H==Y*2:
    ans2 = 1
else:
    ans2 = 0
print(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())

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

a1 = (H-Y) * W
a2 = Y * W
if a1==0 or a2==0:
    a12 = 0
else:
    a12 = min(a1, a2)

a3 = X * H
a4 = (W-X) * H
if a3==0 or a4==0:
    a34 = 0
else:
    a34 = min(a3, a4)

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

    
print(ans1, ans2)

Submission status: Wrong Answer

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

a1 = (H-Y) * W
a2 = Y * W
if a1==0 or a2==0:
    a12 = max(a1, a2)
else:
    a12 = min(a1, a2)

a3 = X * H
a4 = (W-X) * H
if a3==0 or a4==0:
    a34 = max(a3, a4)
else:
    a34 = min(a3, a4)

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

    
print(ans1, ans2)

Submission status: Wrong Answer

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

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(w*h/2, 0)
    exit()
a=min(x,w-x)*h
b=min(y,h-y)*w
if a==b:
    c=1
else:
    c=0
print(max(a,b), c)

Submission status: Wrong Answer

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

a=min(x,w-x)*h
b=min(y,h-y)*w
if a==b:
    c=1
else:
    c=0
print(max(a,b), c)

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(float, input().split())
if x in [0, w] or y in [0, h]:
  print(max(min(x*h, (w-x)*h), min(y*w, (h-y)*w)), 0)
elif x/y == w/h:
  print(max(min(x*h, (w-x)*h), min(y*w, (h-y)*w)), 1)
elif x/(h-y) == w/h:
  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(float, input().split())
if x in [0, w] or y in [0, h]:
  print(w*h/2, 0)
elif x/y == w/h:
  print(max(min(x*h, (w-x)*h), min(y*w, (h-y)*w)), 1)
elif x/(h-y) == w/h:
  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(float, input().split())
if x in [0, w] or y in [0, h]:
  print(0, 0)
elif x/y == w/h:
  print(min(x*h, (w-x)*h), 1)
elif x/(h-y) == w/h:
  print(min(x*h, (w-x)*h), 1)
else:
  print(min(x*h, (w-x)*h, y*w, (h-y)*w), 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())
s1 = min(w-x, x)*h
s2 = min(h-y, y)*w
print(max(s1, s2), 1 if s1 == s2 else 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, 1)
else:
    print(W * H / 2, 0)

Submission status: Wrong Answer

Solution code:
def rectangle_cutting(w, h, x, y):

    a = 0
    ans = min((w-x)*h, x*h)

    if ans == min((h-y)*w, w*y):
        a = 1
    else:
        ans = max(ans, min((h-y)*w, w*y))

    return str(ans)+" "+ str(a)
def main():
    w, h, x, y = map(int, input().split())
    print(rectangle_cutting(w, h, x, y))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc130/tasks/abc130_c

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

ans = w * h / 2

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

print(ans, flag)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc130/tasks/abc130_c

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

area = w * h
s = x * y
if s > area / 2:
    s = area - s

t = h * x
if t > area / 2:
    t = area - t
ans = max(s, t)

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

print(ans, flag)

Submission status: Wrong Answer

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

flag = 1 if x==y else 0

print(str(W*H/2) + " " + str(flag))

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    w,h,x,y=L()
    print(w*h/2,end=" ")
    print(1 if w//2==x and h//2==y else 0)
    

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue May 12 00:13:44 2020

@author: shinba
"""

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

a1 = h*min(w-x,x)
a2 = w*min(h-y,y)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
print("A")

Submission status: Wrong Answer

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

split_area_smax = (w*h)/2
if  x == w//2 and y ==h//2:
    vari_split = 1
else:
    vari_split = 0


print(split_area_smax, vari_split)

Submission status: Wrong Answer

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

flg = 0
s=0

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

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

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

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

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

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

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

print(s,flg)

Submission status: Wrong Answer

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

flg = 0
s=0

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

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

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

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

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

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

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

print(s,flg)

Submission status: Wrong Answer

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

flg = 0
s=0

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

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

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

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

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

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

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

print(s,flg)

Submission status: Wrong Answer

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

flg = 0
s=0

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

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

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

print(s,flg)