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(W*H)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = W * H * 0.5

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

print(S,a)

Submission status: Wrong Answer

Solution code:
W, H, x, y = [int(i) for i in input().split()]

mx = min(W - x, x)
my = min(H - y, y)

sx = mx * H
sy = my * W
s = max(sx, sy)
a = 1 if sx == sy else 0
print(s, a)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 130
# C - Rectangle Cutting

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

if (x,y)==(0,0) or (x,y)==(W,0) or (x,y)==(W,H) or (x,y)==(0,H):
    print(W*H/2 , 0)
if x==0:
    print((H-y)*W,0)
if y==0:
    print((W-x)*H,0)

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 130
# C - Rectangle Cutting

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

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

Submission status: Wrong Answer

Solution code:
import sys
w,h,x,y = map(float,input().split())
S = w*h/2
if x == w/2:
  if y == h/2:
    print([S,1])
    sys.exit()
print([S,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 = 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:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    W,H,x,y = mi()

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




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    W,H,x,y = mi()

    ans = '{:.10f}'.format(W*H/2)
    ans2 = 1 if W==H else 0
    print(ans,ans2)
    




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 12 11:04:24 2020

@author: liang
"""

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

ans = [0] * 2

ans[0] = H*W/2
if x == W//2 and y == H//2:
    ans[1] = 1
else:
    ans[1] = 0
print(" ".join(map(str, ans)))

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:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
INF = 10**19
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

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

    s1 = (W * (H - y))
    s2 = (W * y)
    s3 = ((W - x) * H)
    s4 = (x * H)
    ans = max(min(s1, s2), min(s3, s4))

    k = 0
    if s1 == s2 or s3 == s4 or s1 == s3 or s1 == s4:
        k += 1

    print(ans, k)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
INF = 10**19
def input():
    return sys.stdin.readline()[:-1]
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b

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

    s1 = (W * (H - y))
    s2 = (W * y)
    s3 = ((W - x) * H)
    s4 = (x * H)
    ans = max(min(s1, s2), min(s3, s4))

    k = 0
    if s1 == s2 or s1 == s3 or s1 == s4:
        k += 1

    print(ans, k)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
ans_1=min(H*x,H*(W-x))
ans_2=min(W*y,W*(H-y))
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
elif W%2==0 and H%2==0 and x==int(W/2) and y==int(H/2):
    print(str(W*H/2)+" 1")
elif W%2==0 and H%2==0 and W!=0 and H!=0:
    p=(W/H)*(x-W/2)+H/2
    if p.is_integer()==False:
        pass
    else:
        if int(p)==y:
            print(str(W*H/2)+" 0")
elif W!=0 and H!=0 and x!=0 and y!=0 and (y/x==H/W or (W!=x and y/(W-x)==H/W)):
    print(str(W*H/2)+" 0")
elif ans_1==ans_2:
    print(str(ans_1)+" 1")
else:
    print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
ans_1=min(H*x,H*(W-x))
ans_2=min(W*y,W*(H-y))
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
elif W%2==0 and H%2==0 and x==int(W/2) and y==int(H/2):
    print(str(W*H/2)+" 1")
elif W!=0 and H!=0 and x!=0 and y!=0 and (y/x==H/W or (W!=x and y/(W-x)==H/W)):
    print(str(W*H/2)+" 0")
elif ans_1==ans_2:
    print(str(ans_1)+" 1")
else:
    print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
ans_1=min(H*x,H*(W-x))
ans_2=min(W*y,W*(H-y))
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
elif W%2==0 and H%2==0 and x==int(W/2) and y==int(H/2):
    print(str(W*H/2)+" 1")
elif W!=0 and H!=0 and x!=0 and y!=0 and y/x==H/W:
    print(str(W*H/2)+" 0")
elif ans_1==ans_2:
    print(str(ans_1)+" 1")
else:
    print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
ans_1=min(H*x,H*(W-x))
ans_2=min(W*y,W*(H-y))
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
elif ans_1==ans_2:
    print(str(ans_1)+" 1")
elif W!=0 and H!=0 and x!=0 and y!=0 and y/x==H/W :
    print(str(W*H/2)+" 0")
else:
    print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
elif W!=0 and H!=0 and x!=0 and y!=0 and y/x==H/W:
    print(str(W*H/2)+" 0")
else:
    ans_1=min(H*x,H*(W-x))
    ans_2=min(W*y,W*(H-y))
    if ans_1==ans_2:
        print(str(ans_1)+" 1")
    else:
        print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
if (x==0 and y==0) or (x==0 and y==H) or (x==W and y==0) or (x==W and y==H):
    print(str(W*H/2)+" 0")
else:
    ans_1=min(H*x,H*(W-x))
    ans_2=min(W*y,W*(H-y))
    if ans_1==ans_2:
        print(str(ans_1)+" 1")
    else:
        print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

Solution code:
r=input().split()
W=int(r[0])
H=int(r[1])
x=int(r[2])
y=int(r[3])
ans_1=min(H*x,H*(W-x))
ans_2=min(W*y,W*(H-y))
if ans_1==ans_2:
    print(str(ans_1)+" 1")
else:
    print(str(max(ans_1,ans_2))+" 0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
a = list(map(int,input().split()))
S = a[0]*a[1]/2
if a[0]//2 == a[2] and a[1]//2 == a[3]:
  print(S,1)
else:
  print(S,0)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
s1 = a[2]*a[1]
s2 = (a[0]-a[2])*a[1]
s3 = a[0]*a[3]
s4 = a[0]*(a[1]-a[3])
sm1 = min(s1,s2)
sm2 = min(s3,s4)
if sm1 == sm2:
  print(sm1,1)
else:
  print(max(sm1,sm2),0)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int,input().split())
xwari = min(X*H,(W-X)*H)
ywari = min(Y*W,(H-Y)*W)
if W//2 == X and H//2 == Y:
    f = 1
else:
    f = 0
print(W*H/2, f)

Submission status: Wrong Answer

Solution code:
W,H,X,Y = map(int,input().split())
xwari = min(X*H,(W-X)*H)
ywari = min(Y*W,(H-Y)*W)
if xwari == ywari:
    f = 1
else:
    f = 0
print(max(xwari,ywari),f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

print('{} {}'.format(ans,check))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = max(min(x * h, (w - x) * h), min(w * y, w * (h - y)))
print(ans, pat)

Submission status: Wrong Answer

Solution code:
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(W, H, x, y):
    print(W * H / 2, 1 if x == W // 2 and y == H // 2 else 0)

if __name__ == '__main__':
    input = sys.stdin.readline
    W, H, x, y = map(int, input().split())
    main(W, H, x, y)

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int, input().split())
ans = 0
if w==h: ans += 1
if w%2==0: ans += 1
if h%2==0: ans += 1

if ans > 1: ans = 1
else: ans = 0
print((w*h)/2, ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
if x == W and y == 0:
  print(H*W/2,0)
elif x == W and y == H:
  print(H*W/2,0)
elif x == 0 and y == H:
  print(H*W/2,0)
elif x == 0 and y == 0:
  print(H*W/2,0)
else:
  xx = min(W-x,x)
  yy = min(H-y,y)
  A1 = H*xx
  A2 = W*yy
  res = max(A1,A2)
  if A1 == A2:
    print(res,1)
  else:
    print(res,0)

Submission status: Wrong Answer

Solution code:
W,H,x,y=map(int,input().split())
xx = min(W-x,x)
yy = min(H-y,y)
A1 = H*xx
A2 = W*yy
res = max(A1,A2)
if A1 == A2:
  print(res,1)
else:
  print(res,0)

Submission status: Wrong Answer

Solution code:
H,W,x,y=map(int,input().split())
A1 = H*x
A2 = W*y
res = min(A1,A2)
if A1 == A2:
  print(res,1)
else:
  print(res,0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
str1 = f'{w * h / 2:.09f}'
str2 = '1' if w // 2 == x and h // 2 == y else '0'
print(' '.join([str1,str2]))

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

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

print(W*H/2, a)

Submission status: Wrong Answer

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

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

print(W*H/2, a)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
tot_area = W*H
area = []

area.append(min((W-x)*H, tot_area - (W-x)*H))
area.append(min((H-y)*W, tot_area - (H-y)*W))
sort_area = sorted(area, reverse=True)

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

Submission status: Wrong Answer

Solution code:
'''
Created on 2020/08/29

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  W,H,x,y=map(int,pin().split())
  ans=max(min(x,W-x)*H,min(y,H-y))
  pout(f"{ans} ")
  if W-x==x and H-y==y:
    print(1)
  else:
    print(0)
  return 
main()

Submission status: Wrong Answer

Solution code:
'''
Created on 2020/08/29

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  W,H,x,y=map(int,pin().split())
  ans=max(min(x,W-x)*H,min(y,H-y))
  pout(f"{ans} ")
  if W==H and x==y:
    print(1)
  else:
    print(0)
  return 
main()

Submission status: Wrong Answer

Solution code:
#

import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    w, h, x, y = input_int_list()
    if (x == 0 and (y == 0 or y == h)) or (x == w and (y == 0 or y == h)):
        print(0)
    else:
        a = min(x * h, (w - x) * h)
        b = min(y * w, (h - y) * w)
        bl = (w == 2 * x and h == 2 * y)
        print(max(a, b), 1 if bl else 0)
    return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#

import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    w, h, x, y = input_int_list()
    if (x == 0 and (y == 0 or y == h)) or (x == w and (y == 0 or y == h)):
        print(0)
    else:
        a = min(x * h, (w - x) * h)
        b = min(y * w, (h - y) * w)
        c = 0
        if a == b:
            c = 1
        print(max(a, b), c)
    return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

P = 0
if h > w:
    ans = min(x*h, (w-x)*h)

elif h == w:
    if x != 0 or y != 0:
        P = 1
    ans = max(min(x * h, (w - x) * h), min(y * w, (h - y) * w))

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

print(ans, P)

Submission status: Wrong Answer

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

P = 0
if h > w:
    ans = min(x*h, (w-x)*h)

elif h == w:
    if x != 0 and y != 0:
        P = 1
    ans = max(min(x * h, (w - x) * h), min(y * w, (h - y) * w))

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

print(ans, P)

Submission status: Wrong Answer

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

P = 0
if h > w:
    ans = min(x*h, (w-x)*h)
elif h == w:
    if x != 0 and y != 0:
        P = 1
    ans = min(y*w, (h-y)*w)
else:
    ans = max(min(x*h, (w-x)*h), min(y*w, (h-y)*w))
print(ans, P)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

tall1=x*H
tall2=(W-x)*H

wide1=y*W
wide2=(H-y)*W

if 2*x==W and 2*y==H:
    print(x*H,1)
else:
    if tall1>tall2:
        t=tall2
    else:
        t=tall1
    if wide1>wide2:
        w=wide2
    else:
        w=wide1
    if w<t:
        print(t,0)
    else:
        print(w,0)

Submission status: Wrong Answer

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

tall1=x*H
tall2=(W-x)*H

wide1=y*W
wide2=(H-y)*W

if tall1<tall2:
    t=tall1
else:
    t=tall2

if wide1<wide2:
    w=wide1
else:
    w=wide2

if w<t:
    print(t,0)
elif t<w:
    print(w,0)
else:
    print(t,1)

Submission status: Wrong Answer

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

m=0
m=min(W*y, H*x)

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

Submission status: Wrong Answer

Solution code:
import sys 

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

area = W*H

patternA = (W-x)*(H)
patternB = (W)*(H-y)

Flag=  0
ans = -10**100


if patternA == patternB:
    Flag = 1
    ans = max(ans, patternA)
    print(str(ans) + " " + str(Flag))

else:
    ans = max(ans, patternA,patternB)
    print(str(ans) + " " + str(Flag))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans=(w*h)/2

if x==0 and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
elif x==w and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
elif y==0 and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
elif y==h and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
else:
    print(f'{ans:.06f}',end=' ')
    print('1')

Submission status: Wrong Answer

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

ans=(w*h)/2

if x==0 and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if x==w and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==0 and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==h and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
else:
    print(f'{ans:.06f}',end=' ')
    print('1')

Submission status: Wrong Answer

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

ans=(w*h)/2

if x==0 and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if x==w and 0<=y<=h:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==0 and 0<=x<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
if x==h and 0<=y<=w:
    print(f'{ans:.06f}',end=' ')
    print('0')
else:
    print(f'{ans:.06f}',end=' ')
    print('1')

Submission status: Wrong Answer

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

ans=(w*h)/2

if x==w or x==0:
    print(f'{ans:.06f}',end=' ')
    print('0')
if y==h or y==0:
    print(f'{ans:.06f}',end=' ')
    print('0')
else:
    print(f'{ans:.06f}',end=' ')
    print('1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(float, input().split())
ans =0
if w ==h:
    ans =1
print('{:9f} {}'.format(W*H/2, ans))

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(float, input().split())
ans =0
if w/W+h/H == 1:
    ans =1
elif w/W == h/H:
    ans =1

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

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(float, input().split())
ans =0
if w/W+h/H == 1:
    ans =1
elif w/W == h/H:
    ans =1
    
ls =[float(w*h/2), ans]
print(*ls)

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(float, input().split())
ans =0
if w/W+h/H == 1:
    ans =1
elif w/W == h/H:
    ans =1
    
ls =[float(w*h/2), ' ', ans]
print(*ls)

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(float, input().split())
ans =0
if w/W+h/H == 1:
    ans =1
elif w/W == h/H:
    ans =1
    
print(str(W*H/2)+' '+ str(ans))

Submission status: Wrong Answer

Solution code:
W,H,w,h = map(int, input().split())
ans =0
if w*H+h*W ==W*H:
    ans =1
elif H*w==h*W:
    ans =1
    
print(str(W*H/2)+' '+ str(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if w//2==x and h//2==y:
    ans2=1
else:
    ans2=0
print('{} {}'.format(ans1,ans2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A=H*min(x,W-x)
B=W*min(y,H-y)
if A==B:
    print(A,end=" ")
    print(1)
else:
    print(max(A,B),end=" ")
    print(0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

def solve(W, H, x, y):
  mw, mh = W // 2, H // 2
  return f'{W * H / 2} {int((x, y) == (mw, mh))}'


if __name__ == '__main__':
  print(solve(*map(int, input().split())))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

def solve(W, H, x, y):
  s1 = x * H if x <= W // 2 else (W - x) * H
  s2 = y * W if y <= H // 2 else (H - y) * W
  return f'{max(s1, s2)} {int(s1 == s2)}'


if __name__ == '__main__':
  print(solve(*map(int, input().split())))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_c

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a

w, h, x, y = map(int, input().strip().split())
area = w * h / 2
has_points = 0
if abs(2*x-w) == 0 and h > 1:
    has_points = 1
elif abs(2*y-h) == 0 and w > 1:
    has_points = 1
elif w >= 3*abs(2*x-w) and h >= 3*abs(2*y-h):
    has_points = 1
elif gcd(abs(2*x-w), abs(2*y-h)) > 1:
    has_points = 1

print(area, has_points)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_c

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a

w, h, x, y = map(int, input().strip().split())
area = w * h / 2
has_points = 0
if (w >= 3*abs(2*x-w) and h >= 3*abs(2*y-h)):
    has_points = 1
elif abs(2*x-w) == 0 and h > 1:
    has_points = 1
elif abs(2*y-h) == 0 and w > 1:
    has_points = 1
elif gcd(abs(2*x-w), abs(2*y-h)) > 1:
    has_points = 1

print(area, has_points)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_c

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a

w, h, x, y = map(int, input().strip().split())
area = w * h / 2
has_points = 0
if gcd(abs(2*x-w), abs(2*y-h)) > 1:
    has_points = 1
elif (w >= 3*abs(2*x-w) and h >= 3*abs(2*y-h)):
    has_points = 1
elif abs(2*x-w) == 0 and h > 1:
    has_points = 1
elif abs(2*y-h) == 0 and w > 1:
    has_points = 1
print(area, has_points)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_c

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a

w, h, x, y = map(int, input().strip().split())
area = w * h / 2
has_points = 0
if gcd(abs(2*x-w), abs(2*y-h)) > 1 or abs(2*x-w) * abs(2*y-h) == 0:
    has_points = 1
elif (w > 3*abs(2*x-w) and h > 3*abs(2*y-h)):
    has_points = 1
print(area, has_points)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc130_c

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        tmp = a
        a = b
        b = tmp % b
    return a

w, h, x, y = map(int, input().strip().split())
area = w * h / 2
has_points = 0
if gcd(abs(2*x-w), abs(2*y-h)) > 1 or (w > 3*abs(2*x-w) and h > 3*abs(2*y-h)):
    has_points = 1
print(area, has_points)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_value = -1

# x軸と平行な直線で区切る場合
max_value = max(max_value, min((W-x)*H, x*H))

# y軸に平行な直線で区切る場合
max_value = max(max_value, min(W*(H-y), W*y))

flg = W-x == x or H-y == y 
print(max_value, 1 if flg else 0)

Submission status: Wrong Answer

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

max_value = -1

# x軸と平行な直線で区切る場合
max_value = max(max_value, min((W-x)*H, x*H))

# y軸に平行な直線で区切る場合
max_value = max(max_value, min(W*(H-y), W*y))

flg = W-x == x and H-y == y 
print(max_value, 1 if flg else 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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 = list(map(int, input().split()))
print(W*H/2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if X==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())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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