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: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()
from collections import defaultdict

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

Submission status: Accepted

Solution code:
w, h, x, y=map(int, input().split())
menseki=w*h*0.5
count=0
if x==w/2 and y==h/2:
    count=1
print("{} {}".format(menseki, count))

Submission status: Accepted

Solution code:
#C

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

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

Submission status: Accepted

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: Accepted

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: Accepted

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

print(W*H/2, ans)

Submission status: Accepted

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

Submission status: Accepted

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

def ri():
    return int(input())

def rl():
    return list(input().split())

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
W,H,x,y = (int(x) for x in input().split())
mid_div = float(W*H/2)

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

print(mid_div, way)

Submission status: Accepted

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

print(str(area)+" "+str(fukusu))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

(W,H,x,y) = (int(i) for i in input().split(" "))


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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(W*H/2,s)

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = W * H / 2
ans2 = 1 if x * 2 == W and y * 2 == H else 0

print("{} {}".format(ans1,ans2))

Submission status: Accepted

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

center_y = H/2
center_x = W/2

area = W*H/2
flag = 0
if x == center_x and y == center_y:
    flag = 1
print("{} {}".format(area, flag))

Submission status: Accepted

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

ans = w * h / 2
multiple = 0
if x * 2 == w and y * 2 == h:
    multiple = 1

print("{} {}".format(ans, multiple))

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    X,Y,x,y=map(int, input().split())
    ans = 1 if 2*x==X and 2*y==Y else 0
    print(X*Y/2, ans)


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    W, H, x, y = [int(val) for val in input().split()]
    area = W * H
    if (x == W / 2) and (y == H / 2):
        print(area / 2, 1)
    else:
        print(area / 2, 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

menseki=w*h/2

hantei=0
if x*2==w and y*2==h:
  hantei=1

print(menseki,hantei)

Submission status: Accepted

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

Submission status: Accepted

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

print(W*H/2,(x * 2 == W and y * 2 == H)*1)

Submission status: Accepted

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

ans1 = float(W * H / 2)
ans2 = 0

if W == int(2*x) and H == int(2*y):
    ans2 = 1

print(ans1, ' ', ans2)

Submission status: Accepted

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

# 中心とx,yを通る直線で切る

area = (W*H)/2
bl = (W == 2*x and H == 2*y)
t = 1 if bl else 0

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

Submission status: Accepted

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

ans = W*H/2
if x == W/2 and H/2 == y:
    ans2 = 1
else:
    ans2 = 0

print(ans,ans2)

Submission status: Accepted

Solution code:
W, H, x, y = map(int, raw_input().split())
print W*H*.5, int(x*2==W and y*2==H)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans1 = w * h / 2

if x * 2 == w and y * 2 == h:
    ans2 = 1
else:
    ans2 = 0

print(ans1, ans2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getlist():
	return list(map(int, input().split()))

W, H, x, y = getlist()

S = W * H / 2
if x * 2 == W and y * 2 == H:
	j = 1
else:
	j = 0

print(S, j)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(W: int, H: int, x: int, y: int):
    area = W*H/2.0
    if x == W/2 and y == H/2:
        print(area, 1)
    else:
        print(area, 0)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    H = int(next(tokens))  # type: int
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(W, H, x, y)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans,c)

Submission status: Accepted

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

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

print(W*H/2, cnt)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

W, H, x, y = MAP()


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

Submission status: Accepted

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

Submission status: Accepted

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

score = W*H/2

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

print(score,flag)

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = W*H/2

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

Submission status: Accepted

Solution code:
w, h, x, y = [int(a) for a in input().split()]
dup = (x == w/2) and (y == h/2)
s_dup = 1 if dup else 0

print(str(w * h / 2) + " " + str(s_dup))

Submission status: Accepted

Solution code:
def acinput():
    return list(map(int,input().split(" ")))


W,H,x,y=acinput()

res1=W*H/2
if (x,y)==(W/2,H/2):
    res2=1
else:
    res2=0

print(res1,res2)

Submission status: Accepted

Solution code:


def main():
    w, h, x, y = map(int, raw_input().split())
    if w == x * 2 and h == y * 2:
        c = 1
    else:
        c = 0
    print w * h * 0.5, c


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
import collections
import itertools

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

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

print(area, p)

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
inf = 10 ** 18

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

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

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

W, H, x, y = nl()

area = W*H/2
if W / 2 == x and H / 2 == y:
    print(str(area) + ' 1')
else:
    print(str(area) + ' 0')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def LI(): return list(map(int, input().split()))


w, h, x, y = LI()

is_multiple = int(w == 2*x and h == 2*y)

print(w*h/2, is_multiple)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

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

Submission status: Accepted

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

print(W*H/2, int(W/2==X and H/2==Y))

Submission status: Accepted

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

Submission status: Accepted

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

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

print('{:.10f} {}'.format(w * h / 2, mul))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    x,n = LI()
    if x < n:
        print(0)
    else:
        print(10)
    return

#B
def B():
    n,x = LI()
    l = LI()
    d = 0
    ans = 1
    for i in range(n):
        d += l[i]
        if d <= x:
            ans += 1
    print(ans)
    return

#C
def C():
    w,h,x,y = LI()
    ans = w*h/2
    k = 0
    if x == w/2 and y == h/2:
        k = 1
    print(ans,k)
    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    C()

Submission status: Accepted

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

print(W*H/2, int(x*2 == W and y*2 == H))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections as c
ip = lambda : map(int, input().split())
# ##############
mod = 1e9+7
W,H,x,y = ip()
b = 0
if x == W/2 and y == H/2:
    b = 1
print(W*H/2, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    W, H, x, y = MI()
    ans = (W * H) / 2
    exist = int((W == x * 2) and (H == y * 2))
    print(ans,exist)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

W, H, x, y = map(int, raw_input().split())
flag = 0
if x * 2 == W and y * 2 == H:
    flag = 1
print float(W) * H / 2, flag

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    w,h,x,y = LI()
    t = w * h / 2
    k = 0
    if w / 2 == x and h / 2 == y:
        k = 1

    return "{} {}".format(t,k)


print(main())

Submission status: Accepted

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: Accepted

Solution code:


def main():
    width, high, x, y = map(int, input().split())
    # data = [list(map(int, input().split())) for i in range(num)]

    ans = width * high / 2

    if x == width / 2 and y == high / 2:
        print(ans, 1)
    else:
        print(ans, 0)





if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
T,Y,x,y=map(int,input().split())
a='0'
if T/2==x & Y/2==y:
  a='1'
print(T*Y/2,a)

Submission status: Runtime Error

Solution code:
T,Y,x,y=map(int,input().split())
a='0'
if T/2=x & Y/2=y:
  a='1'
print(T*Y/2,a)

Submission status: Runtime Error

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

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

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

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!=0 and H!=0 and x!=0 and y!=0 and y/x==H/W and W%2==0 and H%2==0 and x=int(W/2) and y=int(H/2):
    print(str(W*H/2)+" 1")
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: Runtime Error

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

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:
        if W%2==0 and H%2==0 and x=int(W/2) and y=int(H/2):
            print(str(ans_1)+" 1")
        else:
            print(str(ans_1)+" 0")
    else:
        print(str(max(ans_1,ans_2))+" 0")

Submission status: Runtime Error

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:
        if y/x!=H/W:
            print(str(max(ans_1,ans_2))+" 0")
        else:
            print(str(max(ans_1,ans_2))+" 1")

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

ans = W * H
ans = float(float(ans) / 2.0)
ans2 = 0
if x == float(float(W) / 2) and y == float(float(H) / 2):
    ans2 = 1

print(ans + " " + ans2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
W,H,x,y = map(int,input().split())
print(W*H*0.5, end="")
print(1 if x=W*0.5 and y=H*0.5: 0)

Submission status: Runtime Error

Solution code:
import collections
W,H,x,y = map(int,input().split())
tmp = []

if W==x*2:
    print(x*H,1)
elif H==y*2:
    print(W*y,1)
else:
    tmp.append(min(H*x,H*(W-x)))
    tmp.append(min(W*y,W*(H-y)))

tmp_cnt = collections.Counter(tmp)
print(tmp_cnt)

if len(tmp_cnt)==1:
    print(max(tmp_cnt.keys()),1)
else:
    print(max(tmp_cnt.keys()),0)

Submission status: Runtime Error

Solution code:
import collections
W,H,x,y = map(int,input().split())
tmp = []

if W==x*2:
    print(x*H,1)
elif H==y*2:
    print(W*y,1)
else:
    tmp.append(min(H*x,H*(W-x)))
    tmp.append(min(W*y,W*(H-y)))

tmp_cnt = collections.Counter(tmp)
tmp_sort = sorted(tmp_cnt.items(),reverse=True)
#print(tmp_sort)
if tmp_sort[0][1]==1:
    print(tmp_sort[0][0],0)
else:
    print(tmp_sort[0][0],1)

Submission status: Runtime Error

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

S = W * H / 2
flag = 1 if W == 2 * x and H == 2 * y else flag = 0
print(S, end=" ")
print(flag)

Submission status: Runtime Error

Solution code:
import bisect
N, K = map(int, input().split())
A = tuple(map(int, input().split()))

s = [0] * (N + 1)
for i in range(N):
    s[i+1] = s[i] + A[i]
ans = 0
for b in range(N):
    i = bisect.bisect_left(s, K + s[b], b)
    ans += (N + 1 - i)
print(ans)

Submission status: Runtime Error

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

if W == 0 or H == 0:

elif 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())
print(w*h/2, int(h/w==y/x))

Submission status: Runtime Error

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==h/w:
  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: Runtime Error

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import sqrt
def main():
    w, h, x, y = map(int, input().split())
    if w / x == 2 and h / y == 2:
        r = x * h
        print(r, 1)
    elif w / x == 2 or h / y == 2:
        if w / x == 2:
            r = x * h
            print(r, 0)
        else:
            r = y * w
            print(r, 0)
    else:
        print(w * h / 2, 0)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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

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

xp = x*H/y
yp = y*W/x

if xp <= W:
    if S <= xp*H/2:
        S = xp*H/2
        ans = 1
if yp <= H:
    if S <= yp*W/2:
        S = yp*W/2
        ans = 1

print(S, ans)

Submission status: Runtime Error

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

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

xp = (x/y)*H
yp = (y/x)*W

if xp <= W:
    if S <= xp*H/2:
        S = xp*H/2
        ans = 1
if yp <= H:
    if S <= yp*W/2:
        S = yp*W/2
        ans = 1

print(S, ans)

Submission status: Runtime Error

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

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

core = (w/2, h/2)
base = h/w
slope = (core[1]-y)/(core[0]-x)

multi = (base >= slope and y == core[1]) or (base < slope and x == core[0])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()

d = Counter(readInts())

d = [i for i in sorted(d.items(), reverse=True) if i[1]>=2]

if len(d)==0:
	print(0)
	exit()
elif len(d)==1:
	if d[0][1]>=4:
		pass
	else:
		print(0)
		exit()
if d[0][1]>=4:
	print(int(d[0][0])**2)
else:
	print(int(d[0][0])*int(d[1][0]))

Submission status: Runtime Error

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

f = 0
if w%h == 0 and x%y == 0:
    f = 1

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