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())
A = min(x*H,(W-x)*H)
B = min(y*W,(H-y)*W)
if A == 0:
    A = W*H
if B == 0:
    B = W*H
if A == B:
    print(A, 1)
else:
    print(max(A, B), 0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
an=[]
if y>=h/2:
  a=w*(h-y)
  an.append(a)
if y<=h/2:
  b=w*y
  an.append(b)
if x>=w/2:
  c=h*(w-x)
  an.append(c)
if x<=w/2:
  d=h*x
  an.append(d)
if y==x:
  e=(w*h)/2
  an.append(e)

g = set(an)
l=len(g)
i=len(an)
an.sort()
if l>1:
  T=0
else:
  T=1

print('{} {}'.format(an[-1], T))

Submission status: Wrong Answer

Solution code:
w, h, x, y = map(int, input().split())
an=[]
if y>=h/2:
  a=w*(h-y)
  an.append(a)
if y<=h/2:
  b=w*y
  an.append(b)
if x>=w/2:
  c=h*(w-x)
  an.append(c)
if x<=w/2:
  d=h*x
  an.append(d)
if y==2*x:
  e=(w*h)/2
  an.append(e)

g = set(an)
l=len(g)
i=len(an)
an.sort()
if l>1:
  T=0
else:
  T=1

print('{} {}'.format(an[-1], T))

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 = [int(IN) for IN in input().split()]

S = W*H/2
st = 0 if x*2==W and y*2==H else 0

print(str(S) +" "+ str(st) )

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split());S1=(w-x)*h;S2=(h-y)*w;print(max(S1,S2),sum([S1==S2]))

Submission status: Wrong Answer

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


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    W, H, x, y = MI()
    x_ratio = x / W
    y_ratio = y / H

    min_ratio = min(x_ratio, y_ratio)

    min_menseki = min_ratio * W * H

    is_same_ratio = 1 if x_ratio == y_ratio else 0

    print(min_menseki, is_same_ratio)


main()

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
x=1
if a%2==0 and a/2==c or b%2==0 and b/2==d:
  if a/2==c and b/2==d:
    pass
  else:
    x=0
s=str((a*b)/2)+" "+str(x)
print(s)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
x=1
if a/2==c or b/2==d:
  if a/2==c and b/2==d:
    pass
  else:
    x=0
s=str((a*b)/2)+" "+str(x)
print(s)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
x=1
if a/2==c and b%2 or b/2==d and a%2:
  x=0
s=str((a*b)/2)+" "+str(x)
print(s)

Submission status: Wrong Answer

Solution code:
w,h,x,y=map(int,input().split())
candi=[x,y,w-x,h-y]
cnt=0
if min(candi)==x:
  res= x*h
  cnt+=1
if min(candi)==y:
  res= w*y
  cnt+=1
if min(candi)==w-x:
  res=(w-x)*h
  cnt+=1
if min(candi)==h-y:
  res=w*(h-y)
  cnt+=1
if cnt>0:
  cnt=1
print(res,cnt)

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
s = H*W
v = x/W
if v > 0.5:
    v = 1 - v
h = y/H
if h > 0.5:
    h = 1 - h
if h == v:
    print(s*h, 1)
elif h > v:
    print(s*h, 0)
else:
    print(s*v, 0)

Submission status: Wrong Answer

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

ans = 0
if x*H == W*y:
    ans = 1
S = max(min(H*x, H*(W-x)), min(W*y, W*(H-y)))

print(S, ans)

Submission status: Wrong Answer

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

ans = 0
if x*H == W*y:
    ans = 1
S = min(x*H, W*y)
print(S, ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

multi = (h/2 == y) or (w/2 == x)

print(w*h/2, 1 if multi else 0)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

multi = (h/w*x == y) or (h/2 == y) or (w/2 == x)

print(w*h/2, 1 if multi else 0)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
s1 = w*y
s2 = w*(h-y)
s3 = h*x
s4 = h*(w-x)
if s1 > s2:
    s5 = s2
else:
    s5 = s1
if s3 > s4:
    s6 = s4
else:
    s6 = s3
if s6 > s5:
    print(float(s6),' 0')
elif s6 < s5:
    print(float(s5),' 0')
else:
    print(float(s6),' 1')

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
s1 = w*y
s2 = w*(h-y)
s3 = h*x
s4 = h*(w-x)
if s1 > s2:
    s5 = s2
else:
    s5 = s1
if s3 > s4:
    s6 = s4
else:
    s6 = s3
if s6 > s5:
    print(float(s5),' 0')
elif s6 < s5:
    print(float(s5),' 0')
else:
    print(float(s6),' 1')

Submission status: Wrong Answer

Solution code:
w,h,x,y = map(int,input().split())
s1 = w*y
s2 = w*(h-y)
s3 = h*x
s4 = h*(w-x)
if s1>s2:
    s5=s2
else:
    s5=s1
if s3>s4:
    s6=s4
else:
    s6=s3
if s6>s5:
    print(s6,' 0')
elif s6<s5:
    print(s5,' 0')
else:
    print(s6,' 1')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans1 = min(x * H, (W - x) * H)
ans2 = min(W * y, W * (H - y))
ans3 = 0
if W / 2 == x and H / 2 == y:
    ans3 = (1/2) * (W * H)
if ans1 == ans2:
    print("{} {}".format(ans1, 1))
else:
    print("{} {}".format(max(ans1, ans2, ans3),0))

Submission status: Wrong Answer

Solution code:
W, H, x, y = map(int, input().split())
ans1 = min(x * H, (W - x) * H)
ans2 = min(W * y, W * (H - y))
if ans1 == ans2:
    print("{} {}".format(ans1, 1))
else:
    print("{} {}".format(max(ans1, ans2),0))

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

area = H*W*0.5
flag = 0
if x+x == W or y+y == H:
	flag = 1
print(area, flag)

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

area = H*W*0.5
flag = 0
if x*2 == W or y*2 == H:
	flag = 1
print(area, flag)

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

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

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

area = (H*W)/2.0
flag = 1
if x == 0 or x == W or y == 0 or y == H:
	flag = 0
print(area, flag)

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

wmin = min((W-x)*H, x*H)
hmin = min(W*(H-y), W*y)
flag = 0
if wmin == hmin:
	if wmin != 0:
		flag = 1
print(max(wmin, hmin), flag)

Submission status: Wrong Answer

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

wmin = min((W-x)*H, x*H)
hmin = min(W*(H-y), W*y)
flag = 0
if wmin == hmin:
	flag = 1
print(max(wmin, hmin), flag)

Submission status: Wrong Answer

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

s = w*h/2 
ans = (w/2, h/2) == (x, y)
print(s, ans)

Submission status: Wrong Answer

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

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

s = max(s1, s2)

if s1 == s2:
    print(s, '1')
else:
    if s == w*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(x, w-x) * h
s2 = min(y, h-y) * w

s = max(s1, s2)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    w, h, x, y = [int(x) for x in input().split()]
    print((w*h)/2, int(w//2 == x and h//2 == y))

        



t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""



"""

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    '''
    code here
    '''
    W, H, x, y = [int(item) for item in input().split()]

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

    print(W*H/2, res)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

s=w*h

tate=min(x*h,s-x*h)

yoko=min(y*w,s-y*w)

if tate==yoko:
  print(str(tate)+' '+str(1))
  
else:
  ans=max(tate,yoko)
  print(str(ans)+' '+str(0))

Submission status: Wrong Answer

Solution code:
import sys
import math


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


def main():
    W, H, x, y = map(int, input().split())
    v = min(x * H, W * H - x * H)
    h = min(W*y,H*W-W*y)
    if v ==h:
        print(v,1)
    else:
        print(max(v,h),0)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

cand1 = min(x * H, (W-x)*H)
cand2 = min(y * W, (H-y)*W)

way = 0

if cand1 == cand2:
  way = 1

print(float(max(cand1, cand2)), way)

Submission status: Wrong Answer

Solution code:
#入力:N,M(int:整数)
def input2():
	return map(int,input().split())
  
W,H,x,y=input2()

ALL=W*H
pt1_under=(W-x)*H #横割り
pt1_up=ALL-(W-x)*H #横割り
if pt1_under>=pt1_up:
	pt1=pt1_up
else:
	pt1=pt1_under

pt2_under=W*(H-y) #縦割り
pt2_up=ALL-W*(H-y) #縦割り
if pt2_under>=pt2_up:
	pt2=pt2_up
else:
	pt2=pt2_under

if pt1==pt2:
	print("{} {}".format(pt1,1))
elif pt1>pt2:
	print("{} {}".format(pt1,0))
else:
	print("{} {}".format(pt2,0))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[5]:


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


# In[6]:


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


# In[ ]:

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

Submission status: Wrong Answer

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

big = max(w,h) * (min(w,h)/2)

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

Submission status: Wrong Answer

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

big = max(w,h) * (min(w,h)/2)

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    W,H,x,y = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    half=(W*H/2)
    if W//2==x and H//2==y:
        print(half,1)
    else:
        print(half,0)




if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

w, h, x, y = rm()
if max(x, w-x)*h > max(y, h-y)*w:
    if x == w/2:
        print(max(y, h-y)*w, 1)
    else:
        print(max(y, h-y)*w, 0)
elif max(x, w-x)*h < max(y, h-y)*w:
    if y == h/2:
        print(max(x, w-x)*h, 1)
    else:
        print(max(x, w-x)*h, 0)
else:
    if y == h/2 or x == w/2:
        print(max(y, h-y)*w, 1)
    else:
        print(max(y, h-y)*w, 0)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

w, h, x, y = rm()
if max(x, w-x)*h > max(y, h-y)*w:
    if y == h/2:
        print(max(y, h-y)*w, 1)
    else:
        print(max(y, h-y)*w, 0)
    if x == w/2:
        print(max(x, w-x)*h, 1)
    else:
        print(max(x, w-x)*h, 0)
elif max(x, w-x)*h < max(y, h-y)*w:
    if x == w/2:
        print(max(x, w-x)*h, 1)
    else:
        print(max(x, w-x)*h, 0)
else:
    if y == h/2 or x == w/2:
        print(max(y, h-y)*w, 1)
    else:
        print(max(y, h-y)*w, 0)

Submission status: Wrong Answer

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

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())
tmp1 = abs(w-x)
tmp2 = abs(h-y)

if tmp1 > tmp2:
    tmp = min(tmp2,y)
    print(w*tmp)
else:
    tmp = min(tmp1,x)
    print(h*tmp)

Submission status: Wrong Answer

Solution code:
if __name__=="__main__":
    w,h,x,y=[int(x) for x in input().split()]

    a=(w*h)/2

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

Submission status: Wrong Answer

Solution code:
if __name__=="__main__":
    w,h,x,y=[int(x) for x in input().split()]

    a=(w*h)/2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from operator import itemgetter

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    W, H, x, y = mi()

    s = W*H/2
    cut = 1 if W//2 == x and H//2 == y else 0

    print(s, cut)

    return

main()

Submission status: Wrong Answer

Solution code:

def solve():
    gx,gy = False, False
    if W/2 == x:
        gx = True
    if H/2 == y:
        gy = True
    A1 = min(x*H, (W-x)*H)
    A2 = min(x*y, x*(H-y))
#    print(A1)
    ans = max(A1, A2)
#    print(gx,gy)
    if gx and gy:
        print(ans, 1)
    else:
        print(ans, 0)

    

if __name__ == "__main__":
    W,H,x,y = list(map(float, input().split()))
    solve()

Submission status: Wrong Answer

Solution code:

def solve():
    gx,gy = False, False
    if W/2 == x:
        gx = True
    if H/2 == y:
        gy = True
    A1 = min(x*H, (W-x)*H)
    A2 = min(x*y, x*(H-y))
#    print(A1)
    ans = max(A1, A2)
#    print(gx,gy)
    if gx and gy:
        print(ans, 1)
    else:
        print(ans, 0)

    

if __name__ == "__main__":
    W,H,x,y = list(map(int, input().split()))
    solve()

Submission status: Wrong Answer

Solution code:

def solve():
    gx,gy = False, False
    if W/2 == x:
        gx = True
    if H/2 == y:
        gy == True
    A1 = min(x*H, (W-x)*H)
    A2 = min(x*y, x*(H-y))
#    print(A1)
    ans = max(A1, A2)
    if gx and gy:
        print(ans, 0)
    else:
        print(ans, 1)

    

if __name__ == "__main__":
    W,H,x,y = list(map(int, input().split()))
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(max(a,b),int(x*2 == W and y*2 == H))

Submission status: Wrong Answer

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

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

print(max(a,b),x*2 == W and y*2 == H)

Submission status: Wrong Answer

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

a,b = min(x*H, (W-x)*H), min(y*W, (W-y)*W)
if a != b:
    print(max(a,b),0)
else:
    print(a,1)

Submission status: Wrong Answer

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

ans = max(min(x*H, (W-x)*H), min(y*W, (W-y)*W))
if ans % W and ans % H:
    print(ans,0)
else:
    print(ans,1)

Submission status: Wrong Answer

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

ans = min(x*H, (W-x)*H, y*W, (W-y)*W)
if ans % W and ans % H:
    print(ans,0)
else:
    print(ans,1)

Submission status: Wrong Answer

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

a,b = x*H, (W-x)*H
c,d = y*W, (W-y)*W
if min(a,b) == min(c,d):
    print(min(a,b),1)
else:
    print(max(min(a,b),min(c,d)),0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    w, h, x, y = map(int, input().split())
    ans = 0
    if x*h == y*w:
        ans = 1
    print(float(min(x*h, y*w)), ans)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.buffer.readline
import os
from math import*


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

Submission status: Wrong Answer

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

#print(W,H,x,y)
if x == W/2 and y == H/2:
    area =  "{0:.6f}".format(float(x*H))
    print(area,1)
else:
    area ="{0:.6f}".format(float(min((W-x)*H,x*H)))
    print(area,0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
 
w,h,x,y = map(int,input().split())
 
 
s = w*h
 
if (w-x)*h > (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(0)
elif (w-x)*h == (h-y)*w:
    print(float((w-x))*h,end = " ")
    print(1)
else:
    print(float((h-y))*w,end = " ")
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = w*h

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

Submission status: Wrong Answer

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

s = w*h

if (w-x)*h > (h-y)*w:
    print(s-w*y)
    print(0)
elif (w-x)*h == (h-y)*w:
    print(s-w*y,end = " ")
    print(1)
else:
    print(s-x*h,end = " ")
    print(0)

Submission status: Wrong Answer

Solution code:
a, b, x, y = map(int, input().split())
ab= a*b
ans1 = max(min(y*a, ab-y*a), min(x*b, ab-x*b))
ans2 = 0


if b/2 == y and a/2 == x:
    ans2 = 1
print(ans1, ans2)

Submission status: Wrong Answer

Solution code:
W,H,x,y = map(int,input().split())
men=W*H
if(W*(H-y)==(W-x)*H):
    print(str(W*(H-y))+' 1')
else:
    ans=min(men-W*(H-y),men-(W-x)*H)
    print(str(float(ans))+' 0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    w, h, x, y = MI()
    s_x = h*min(x, w-x)
    s_y = min(y, h-y)*w
    print("{} {}".format(max(s_x, s_y), int(s_x==s_y)))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x * 2 == W and y * 2 == 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_1 = min(W*y, W*(H-y))
ans_2 = min(x*H, (W-x)*H)

if ans_1 == ans_2 and ans_1 >= 1:
    print(ans_1, 1)
else:
    print(max(ans_1,ans_2), 0)

Submission status: Wrong Answer

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

ans_1 = min(W*y, W*(H-y))
ans_2 = min(x*H, (W-x)*H)

if ans_1 == ans_2:
    if ans_1 == 0:
        print(0, 0)
    else:
        print(ans_1, 1)
else:
    print(max(ans_1,ans_2), 0)

Submission status: Wrong Answer

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

ans_1 = min(W*y, W*(H-y))
ans_2 = min(x*H, (W-x)*H)

if ans_1 == ans_2:
    print(ans_1, 1)
else:
    print(max(ans_1,ans_2), 0)