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: Runtime Error

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d = [None for i in range(4)]
d[0] = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d[1] = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)
d[2] = abs(x-w*0.5)
d[3] = abs(y-h*0.5)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d.index().min(d) == 0:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
elif d.index().min(d) == 1:
  if int(d[0]-d[1]) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)
elif d.index().min(d) == 2:
  print(1,1)
  eixt()
  if y > 0.5*h:
    b = w*y/(w-2*x)
    x1=(x-0.5*w)/y*(b-h)
    if x > 0.5*w:
      print(h*(0.5*w+w-x1)*0.5, 0)
    else:
      print(h*(0.5*w+0.5*w-x1)*0.5, 0)
  else:
    b = h - 0.5*w*y/(x-0.5*w)
    x1=b*y/(0.5*w-x)
    if x > 0.5*w:
      print(0.5*h(0.5*w+w-x1), 0)
    else:
      print(0.5*h(0.5*w+0.5*w-x1), 0)    
elif d.index().min(d) == 3:
  if int(d[2]-d[3]) == 0:
    casenum = 1
  else:
    casenum = 0
  if x > 0.5*w:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(y-0.5*h)/x*w+0.5*h), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(y-0.5*h)/x*w+0.5*h), casenum)
  else:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)

Submission status: Runtime Error

Solution code:
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d = [None for i in range(4)]
d[0] = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d[1] = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)
d[2] = abs(x-w*0.5)
d[3] = abs(y-h*0.5)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d.index().min(d) == 0:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
elif d.index().min(d) == 1:
  if int(d[0]-d[1]) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)
elif d.index().min(d) == 2:
  if y > 0.5*h:
    b = w*y/(w-2*x)
    x1=(x-0.5*w)/y*(b-h)
    if x > 0.5*w:
      print(h*(0.5*w+w-x1)*0.5, 0)
    else:
      print(h*(0.5*w+0.5*w-x1)*0.5, 0)
  else:
    b = h - 0.5*w*y/(x-0.5*w)
    x1=b*y/(0.5*w-x)
    if x > 0.5*w:
      print(0.5*h(0.5*w+w-x1), 0)
    else:
      print(0.5*h(0.5*w+0.5*w-x1), 0)    
elif d.index().min(d) == 3:
  print(1,1)
  eixt()
  if int(d[2]-d[3]) == 0:
    casenum = 1
  else:
    casenum = 0
  if x > 0.5*w:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(y-0.5*h)/x*w+0.5*h), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(y-0.5*h)/x*w+0.5*h), casenum)
  else:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)

Submission status: Runtime Error

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

print(S,ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W,H,x,y = gets.split.map(&:to_i)


div_x = [x*H,(W-x)*H].min
div_y = [y*W,(H-y)*W].min

another = div_x == div_y ? 1 : 0
puts "#{[div_x,div_y].max * 1.0} #{another}"

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    count = 0
    count_dict = {}
    for i in range(n):
        input_data = ''.join(sorted(input()))
        if input_data in count_dict:
            count += count_dict[input_data]
            count_dict[input_data] += 1
        else:
            count_dict[input_data] = 1
    print(count)
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    w,h,x,y = map(int,input().split())
    if x + x == w and y + y == h::
        a = 1
    else:
        a = 0

    print("%f %d" %(w*h/2, a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if W//2 == x and H//2 == y:
  print(

Submission status: Runtime Error

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

tate = min(W,W-x)*H
yoko = min(H,H-y)*W
area = str(max(tate,yoko))
if H/W == y/x:
    print(area+" 1")
else:
    print(area+" 0")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
 print("{:.9g}" {}.format(area/2,1))

Submission status: Runtime Error

Solution code:
import numpy as np

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

print(max_area, flag)

Submission status: Runtime Error

Solution code:
mentu=0
toitu=0
kouho=0
fuurosu=0
temp=0
hutu_shanten=8

def tehai():
    l=[0]*39
    A=list(map(int,input().split()))
    for i in range(14):
        a=A[i]
        l[a]=l[a]+1
    return l

def kokushi_shantensu(l):
    kokushi_totitsu=0
    kokushi_shanten=13
    for i in range(30):
        if (i%10==1 or i%10==9):
            if l[i]==1:
                kokushi_shanten=kokushi_shanten-1
            if l[i]>1:
                kokushi_shanten=kokushi_shanten-1
                kokushi_totitsu=1
    for i in range(31,38):
        if l[i]==1:
            kokushi_shanten=kokushi_shanten-1
        if l[i]>1:
            kokushi_shanten=kokushi_shanten-1
            kokushi_totitsu=1
    kokushi_shanten=kokushi_shanten-kokushi_totitsu
    return kokushi_shanten

def toitsu_shantensu(l):
    toitsu_shanten=6
    syurui=0
    for i in range(1,38):
        if l[i]>=1:
            syurui=syurui+1
        if l[i]>=2:
            toitsu_shanten=toitsu_shanten-1
    if syurui<7:
        toitsu_shanten=toitsu_shanten+7-syurui
    return toitsu_shanten

def hutu_shantensu(l):
    global mentu
    global toitu
    global kouho
    global fuurosu
    global temp
    global hutu_shanten
    for i in range(1,38):
        if 2<=l[i]:
            toitu=toitu+1
            l[i]=l[i]-2
            mentu_cut(1)
            l[i]=l[i]+2
            toitu=toitu-1
    mentu_cut(1)
    return hutu_shanten

def mentu_cut(n):
    global mentu
    global toitu
    global kouho
    global fuurosu
    global temp
    global hutu_shanten
    for i in range(n,39):
        if i==38:
            taatu_cut(1)
            return
        else:
            c=0
            if l[i]>0:
                c=i
                break
    if l[c]>=3:
        mentu+=1
        l[c]-=3
        mentu_cut(c)
        l[c]+=3
        mentu-=1
    if c<30:
        if (l[c+1]>=1 and l[c+2]>=1):
            mentu+=1
            l[c]-=1
            l[c+1]-=1
            l[c+2]-=1
            mentu_cut(c)
            l[c]+=1
            l[c+1]+=1
            l[c+2]+=1
            mentu-=1
    mentu_cut(c+1)

def taatu_cut(k):
    global mentu
    global toitu
    global kouho
    global fuurosu
    global temp
    global hutu_shanten
    for i in range(k,39):
        if i==38:
            temp=8-mentu*2-kouho-toitu
            if temp<hutu_shanten:
                hutu_shanten=temp
            return
        else:
            d=0
            if l[i]>0:
                d=i
                break
    if mentu+kouho<4:
        if l[d]==2:
            kouho+=1
            l[d]-=2
            taatu_cut(d)
            l[d]+=2
            kouho-=1
        if d<30:
            if l[d+1]>0:
                kouho+=1
                l[d]-=1
                l[d+1]-=1
                taatu_cut(d)
                l[d]+=1
                l[d+1]+=1
                kouho-=1
        if d<30:
            if(l[d+2]>0 and d%10<=8):
                kouho+=1
                l[d]-=1
                l[d+2]-=1
                taatu_cut(d)
                l[d]+=1
                l[d+2]+=1
                kouho-=1
    taatu_cut(d+1)

def shantensu(l):
    return min(kokushi_shantensu(l),toitsu_shantensu(l),hutu_shantensu(l))

def maptotehai(l):
    te=[[0,0] for _ in range(14)]
    c=0
    for n in range(1,38):
        if l[n]>0:
            te[c][0]=n
            te[c][1]=l[n]
            c=c+1
    return te

def tehaitomap(te):
    l=[0]*39
    for n in range(14):
        l[te[n][0]]=te[n][1]
    return l

def ukeire(l):
    s=shantensu(l)
    uke=[[0,0] for _ in range(14)]
    te=maptotehai(l)
    for n in range(14):
        if te[n][1]>0:
            te[n][1]-=1
            uke[n][0]=te[n][0]
            ll=tehaitomap(te)
            for i in range(1,38):
                if i%10!=0:
                    if ll[i]<4:
                        ll[i]+=1
                        hutu_shanten=8
                        if shantensu(ll)==s-1:
                            uke[n][1]+=1
                        ll[i]-=1
            te[n][1]+=1
    return(uke)


l=tehai()
ll=tehai()
print(shantensu(l))
print(shantensu(ll))

Submission status: Runtime Error

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

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
w,h,x,y=(map(int,input().split()))
xeven=(w%2==0)
yeven=(h%2==0)
if(xeven and yeven):
	if(x==w//2 and y==w//2):
		print(w*h/2,1)
elif(xeven and x==w//2):
	print(w*h/2,0)
elif(yeven and y==h//2):
	print(w*h/2,0)
else:
	a=[]
	a.append((0,0,0))
	a.append((0,w,0))
	a.append((h,0,0))
	a.append((h,w,0))
	i=0
	while(i<4):
		a[i][2]=(x-a[0])**2+(y-a[1])**2
		i+=1
	a.sort(key=lambda b:b[2])
	mini=a[0]
	maxi=a[4]
	xclose=abs(mini[0]-x)<abs(mini[1]-y)
	slope=abs(x-maxi[0])/abs(y-maxi[1])
	if(xclose):
		ynew=abs(mini[0]-x)/slope
		print(abs(maxi[1]-mini[1])*(abs(x-maxi[0])+ynew)/2,0)
	else:
		ynew=abs(mini[1]-y)*slope
		print(abs(maxi[0]-mini[0])*(abs(y-maxi[1])+ynew)/2,0)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

n5 = (n1 * n2) / 2

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

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

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

n6 = max(n6, n9)

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

print(str(n6) + s10)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
import numpy as np
W,H,x,y = map(float, input().split())
print("{0} {1}".format(W*H/2, 1 (x+x==W)and(y+y==H) else 0) )

Submission status: Runtime Error

Solution code:
import numpy as np
W,H,x,y = map(float, input().split())
print("{0} {1}".format(W*H/2, 1 (x+x=W)and(y+y=H) else 0) )

Submission status: Runtime Error

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

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

max=W*H*0.5

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

Submission status: Runtime Error

Solution code:
s1_1 = x * H
s1_2 = (W-x) * H

s2_1 = W * y
s2_2 = W * (H-y)


s1_min = min(s1_1, s1_2)
s2_min = min(s2_1, s2_2)

s_max = max(s1_min, s2_min)


has_same = 1 if (s1_min == s2_min) else 0

print(s_max, has_same)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
w,h,x,y = map(int,input().split())
ans = [0,0]
ans[0] = w*h // 2
ans[1] = max(1,abs(w//2-x + h//2-y))
print (f"{ans[0]} {ans[1]}")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(f"{S} {ans}")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(sq,flag)

Submission status: Runtime Error

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

m = (w*h)/2

if (2*x == w) and (2*y == h:)
  s = 1
else:
  s = 0
  

print("{:.9}".format(m));print(s)

Submission status: Runtime Error

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

m = (w*h)/2

if (2*x == w) and (2*y == h:)
  s = 1
else:
  s = 0
  

print("{:.10}".format(m),end='');print(s)

Submission status: Runtime Error

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

print("{} 0".format(W*H/2)

Submission status: Runtime Error

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

print("{} 0".format(W*H/2)

Submission status: Runtime Error

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

if W/2 > x:
  sq1 = x * H
else:
  sq1 = (W-x) * H
  
if H/2 > y:
  sq2 = y * W
else:
  sq2 = (H-y) * W
if sq1 == sq2:
  print("{} 1".format(sq1))
elif sq1 > sq2:
  #print("{} 0".format(sq1))
#else:
 # print("{} 0".format(sq2))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (y/x == H/W):
  print(S, 1)
else:
  print(S, 0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
program main
  implicit none
  integer :: x, y, w, h
  real :: area
  integer :: flag

  read(*,*) w, h, x, y
  area = w*h/2.0

  if (x == w/2 .and. y == h/2) then
    flag = 1
  else
    flag = 0
  endif

  write(*,*) area, flag

end program main

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if W/x == H/y:
    print(W*H/2,1)
elif W/2 == float(x) or H/2 == float(y):
    print(W*H/2,0)
else:
    print(max(min(x,W-x)*H,min(y,H-y)*W),0)

Submission status: Runtime Error

Solution code:
a = list(map(float,input().split(),9))
answer = float(a[0] * a[1])
print(answer)
if a[2] == a[0]/2:
  if a[3] == a[1]/2:
    print(1)
  else:
    print(0)
else:
  print(0)

Submission status: Runtime Error

Solution code:
a = list(map(float,input().split(),9))
answer = float(a[0] * a[1],9)
print(answer)
if a[2] == a[0]/2:
  if a[3] == a[1]/2:
    print(1)
  else:
    print(0)
else:
  print(0)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(a, b):
	return a * b // gcd (a, b)

a,b,c,d = map(int,input().split())
ac_can = int((a-1)//c)
ad_can = int((a-1)//d)
acd_can = int((a-1)//lcm(c,d))
bc_can = int(b//c)
bd_can = int(b//d)
bcd_can = int(b//lcm(c,d))
print(b-a+1-(bc_can+bd_can-bcd_can-(ac_can+ad_can-acd_can)))

Submission status: Runtime Error

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

area = 0
multi = 0
ratio_w = abs(0.5 - W / x)
ratio_h = abs(0.5 - H / y)

if ratio_w > ratio_h:                                                                                                                                                                                       
    area = H * x                                                                                                                                                                                            
elif ratio_w < ratio_h:                                                                                                                                                                                     
    area = W * y                                                                                                                                                                                            
elif ratio_w == ratio_h:                                                                                                                                                                                    
    area = W * y                                                                                                                                                                                            
    multi = 1                                                                                                                                                                                               

print(area, multi)

Submission status: Runtime Error

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

m_x, m_y = w / 2, h / 2

a = (x - m_x) / (y - m_y)

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

Submission status: Runtime Error

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

def calc_aspect_ratio(x, y):
    return max(x, y) / min(x, y)

# 長方形の中心で対称
if (H-y) < y:
    y = H-y

if (W-x) < x:
    x = W-x

area = 0
dup = 0

# 頂点に乗る場合対角線で分断できる
# 上記の点移動の処理により(x,y)=(0,0)しかありえない
if (x == 0) & (y == 0):
    area = W * H / 2

# 辺xに点が乗っている場合
elif (x != 0) & (y == 0):
    area = x * H

# 辺yに点が乗っている場合
elif (y == 0) & (y != 0):
    area = y * W

# 内点の場合
else:
    aspect_rect = calc_aspect_ratio(W, H)
    aspect_point = calc_aspect_ratio(x, y)

    # 対角線上に点が乗っている場合は半分に分けられる
    if aspect_rect == aspect_point:
        area = W * H / 2

        # かつ点が長方形の中心に位置する場合は二通りの分割を達成できる
        if ((H-y) == y) & ((W-x) == x):
            dup = 1
    
    # 対角線外の点の場合
    else:
        area = max(y*W, x*H)

print('{} {}'.format(area, dup))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

w, h, x, y = map(int,input().split())
if w/2 == x and h/2 == y:
        max = (w*h)/2
        print("{} 1".format(max))
else:
        max = (w*h)/2
        print("{} 0".format(max))
~

Submission status: Runtime Error

Solution code:
x_input = list(map(int,input().rstrip().split(" ")))

def makey(x_input):
    W,H,x,y = x_input
    is_only = True
    if x>y:
        S = x*H
    elif x==y:
        if W>=H:
            S = W*x
        else:
            S = x+H
    else:
        S = W+y
    if x!=0 and y!=0:
	    if W/x==H/y:
    	    is_only = False
    return S, is_only

y,is_only = makey(x_input)
if is_only:
  z = 0
else:
  z = 1

print(y, z)

Submission status: Runtime Error

Solution code:
x_input = list(map(int,input().rstrip().split(" ")))

def makey(x_input):
    W,H,x,y = x_input
    is_only = True
    if x>y:
        S = x*H
    elif x==y:
        if W>=H:
            S = W*x
        else:
            S = x+H
    else:
        S = W+y
    if W/x==H/y:
        is_only = False
    return S, is_only

y,is_only = makey(x_input)
if is_only:
  z = 0
else:
  z = 1

print(y, z)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
# coding: utf-8
import time
import re
import math
 
def main():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))
    count=0
    for l in range(N):
        start=0
        for r in range(l,N):
            start+=A[r]
            if start>=K:
                
                count+=N-r
                break
    print(count)
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#n=int(input())
# global n,A,s,memo,mx,mn,L,B

Submission status: Runtime Error

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

print(answer,q)

Submission status: Runtime Error

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

print(f"{area} {isMultiple}")

Submission status: Runtime Error

Solution code:
W = int(input())
H = int(input())
x = int(input())
y = int(input())
if(float(x) == float(W/2) and float(y) == float(H/2)):
    a = W*H/2
    b = 1
    print("{0:7f}".format(a))
    print(b)
else:
  a = W*H/2
  b = 0
  print("{0:7f}".format(a))
  print(b)

Submission status: Runtime Error

Solution code:
W, H , x, y = int(input()), int(input()), int(input()), int(input())
if(float(x) == float(W/2) and float(y) == float(H/2)):
    a = W*H/2
    b = 1
    print("{0:7f}".format(a))
    print(b)
else:
  a = W*H/2
  b = 0
  print("{0:7f}".format(a))
  print(b)

Submission status: Runtime Error

Solution code:
W, H , x, y = int(input()), int(input()), int(input()), int(input())
def function(W, H, x, y)
  if(float(x) == float(W/2) and float(y) == float(H/2)):
      a = W*H/2
      b = 1
      print("{0:7f}".format(a))
      print(b)
  else:
      a = W*H/2
      b = 0
      print("{0:7f}".format(a))
      print(b)
  return 0
  
if __name__ == "__main__":
  function(W, H, x, y)

Submission status: Runtime Error

Solution code:
def function(){
  W, H , x, y = int(input()), int(input()), int(input()), int(input())
  if(float(x) == float(W/2) and float(y) == float(H/2)):
      a = W*H/2
      b = 1
      print("{0:7f}".format(a))
      print(b)
  else:
      a = W*H/2
      b = 0
      print("{0:7f}".format(a))
      print(b)
  return 0
  
if __name__ == "__main__":
  function

Submission status: Runtime Error

Solution code:
def function(){
  W, H , x, y = int(input()), int(input()), int(input()), int(input())
  if(float(x) == float(W/2) and float(y) == float(H/2)):
      a = W*H/2
      b = 1
      print("{0:7f}".format(a))
      print(b)
  else:
      a = W*H/2
      b = 0
      print("{0:7f}".format(a))
      print(b)
  return 0

Submission status: Runtime Error

Solution code:
W, H , x, y = int(input()), int(input()), int(input()), int(input())
if(float(x) == float(W/2) and float(y) == float(H/2)):
    a = W*H/2
    b = 1
    print("{0:7f}".format(a))
    print(b)
else:
    a = W*H/2
    b = 0
    print("{0:7f}".format(a))
    print(b)

Submission status: Runtime Error

Solution code:
width, height, x, y = map(float,　input().split())

center_x = width/2
center_y = height/2

label = 0
if x === center_x && y === center_y:
    s = width * height/2
    label = 1

print(s, label)

Submission status: Runtime Error

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

if x == W // 2 and y == H //2:
    flg = 1

print("{} {}".format(S, flg))

Submission status: Runtime Error

Solution code:
# 真ん中を通れば必ず二分できてこれが最大値だが、自分自身が真ん中の座標の場合は自分自信を通るどんな直線も二分できる
w, h, x, y = map(int, input().split())
ans1 = (w * h) / 2.0
ans2 = 1 if w // x == h // y == 2 else 0
print(ans1, ans2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W,H,x,y= map(int,input().split())
big_square = W * H
square_1 = (W - x) * H
square_12 = big_square - square_1
if square_1 <= square_12:
  s = square_1
elif square_1> square_12:
  s = square_12

square_2 = W * (H - y)
square_22 = big_square - square_2
if square_2 <= square_22:
  t = square_2
elif square_> square_22:
  t = square_22

if s<=t:
  big = t
elif t<s:
  big = s


  
if W == x *2 and H == y *2:
  way = 1
else:
  way = 0
  

print(big,way)

Submission status: Runtime Error

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: Runtime Error

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

a=int(0)

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

print(double(w*h/2)+" "+a)