Problem:


Score : 200 points

Problem Statement

Given are integers a,b,c and d.
If x and y are integers and a \leq x \leq b and c\leq y \leq d hold, what is the maximum possible value of x \times y?

Constraints

-10^9 \leq a \leq b \leq 10^9

-10^9 \leq c \leq d \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

a b c d

Output

Print the answer.

Sample Input 1

1 2 1 1

Sample Output 1

2

If x = 1 and y = 1 then x \times y = 1.
If x = 2 and y = 1 then x \times y = 2.
Therefore, the answer is 2.

Sample Input 2

3 5 -4 -2

Sample Output 2

-6

The answer can be negative.

Sample Input 3

-1000000000 0 -1000000000 0

Sample Output 3

1000000000000000000



Sample input:
1 2 1 1


Sample output:
2

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

if a >= 0 and b>=0 :
    if c >= 0 and d>= 0:
        print(b*d)
    elif d < 0 :
        print(a*d)

if b < 0 :
    if d < 0 or (c < 0 and d >= 0):
        print(a*c)
    else :
        print("0")

if a < 0 and b>= 0 :
    if d < 0 :
        print(a*c)
    elif c >= 0 :
        print(a*d)
    else :
        if abs(a) > b :
            if abs(c) > d :
                print(a*c)
            else :
                print(b*d)
        else :
            if abs(c) > d :
                print(a*c)
            else :
                print(b * d)

Submission status: Wrong Answer

Solution code:
def main():
    a,b,c,d=(int(x) for x in input().split())
    if b>0 and d>0:
        x=b
        y=d
        print(x*y)
    elif a<=0 and c<=0:
        x=a
        y=c
        print(x*y)
    elif b>d:
        x=a
        y=d
        print(x*y)
    elif b<d:
        x=b
        y=c
        print(x*y)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]
if a<=b and c<=d:
    mat = np.array([])
    for i in [a,b]:
        for j in [c,d]:
            mat = np.append(mat, i*j)
    print(int(np.max(mat)))

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

xp = True if a + b > 0 else False
yp = True if c + d > 0 else False

if xp:
  if yp:
    ans = b * d
  else:
    ans = a * d
else:
  if yp:
    ans = b * c
  else:
    ans = b * d

print(ans)

Submission status: Wrong Answer

Solution code:
nums = [int(e) for e in input().split()]
a=nums[0]
b=nums[1]
c=nums[2]
d=nums[3]
i = 0
j = 0
max = a*c
if not a < 0 and c < 0:
    for i in range(a, b+1, 1):
        for j in range(c, d+1, 1):
            if max < i * j:
                max = i * j

print(max)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
za=abs(a)
zb=abs(b)
zc=abs(c)
zd=abs(d)
if a<0 and c<0 :
  if b>=0 and d>=0:
    if a*c >= b*d:
      print(a*c)
    else:
      print(b*d)
  elif b<0 and d<0:
    x=max(za,zb)
    y=max(zc,zd)
    print(x*y)
    
elif a>=0 and d<0:
  print(a*d)
elif b<0 and d<0:
  print(a*c)
else:
  print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

if a >= 0 and c >= 0:
    print(b*d)
elif b <= 0 and d <= 0:
    print(a*c)
elif a >= 0 and d <= 0:
    print(a*d)
elif c >= 0 and b <= 0:
    print(b*c)

Submission status: Wrong Answer

Solution code:
nums = [int(i) for i in input().split()]
a = nums[0]
b = nums[1]
c = nums[2]
d = nums[3]
ac = a*c
bd = b*d
if (ac<0 and bd<0):
  max = a*d
elif (ac>=0 and bd>=0) or (ac<=0 and bd<=0):
  max = max(ac, bd)
elif ac>=0:
  max = ac
elif bd>=0:
  max = bd
  
print(max)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if a >=0 and c>=0:
    print(b*d)
elif b <= 0 and d <= 0:
    print(a*c)
elif b*c <= 0:
    print(max(b*c,a*d))
else:
    print(max(a*c,b*d))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b > 0 and d > 0:
    print(b * d)
elif b > 0 and d < 0:
    print(a * d)
elif b < 0 and d > 0:
    print(b * c)
elif b <= 0 and d <= 0:
    print(a * c)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if d<0<b:
  print(d*a)
elif b<0<d:
  print(b*c)
elif b>=0:
  print(b*d)
else:
  print(a*c)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
x = max([a, b])
y = max([c, d])
print(x*y)

Submission status: Wrong Answer

Solution code:
a,b,c,d = list(map(int,input().split()))
if (a<=0 and 0<=b) or (c<=0 and 0<= d):
    ls = [0]
else:
    ls = []

print(ls)
ls.append(a*c)
ls.append(a*d)
ls.append(b*c)
ls.append(b*d)

ans = max(ls)
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b<0 and c<0:
    print(a*c)
elif b<0 and d==0:
    print(b*c)
elif b<0 and c>0:
     print(b*c)
elif b==0 and d<0:
    print(a*d)
elif b==0 and d==0:
    print(a*c)
elif b==0 and c>0:
     print(b*c)
elif a>0 and d<0:
    print(a*d)
elif a>0 and d==0:
    print(a*d)
elif a>0 and d>0:
    print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

xp = True if a + b > 0 else False
yp = True if c + d > 0 else False

if xp:
  if yp:
    ans = b * c
  else:
    ans = a * d
else:
  if yp:
    ans = b * c
  else:
    ans = b * d

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif b>0 and d<=0:
    print(a*d)
elif b<=0 and d>0:
    print(b*c)
else:
    print(a*c)

Submission status: Wrong Answer

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

if value[0] == value[1] == value[2] == value[3] == 0:
    print("0")
elif value[2] < 0 and value[0] < 0:
    print(value[0] * value[2])
elif 0 < value[0] < value[1] and value[2] < value[3] < 0:
    print(value[0] * value[3])
elif 0 < value[0] < value[1] and 0 < value[1] < value[2]:
    print(value[1] * value[3])
else:
    print(value[1] * value[2])

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
print(max(a*c,a*d,b*c,b*c))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b <= 0 and d <= 0:
    print(c * a)

elif b > 0 and d > 0:
    print(b * d)

elif b <= 0 and d >= 0:
    if c > 0:
        print(c * b)
    else:
        print(a * c)

elif b >= 0 and d <= 0:
    if a > 0:
        print(a * d)
    else:
        print(a * c)

else:
    print(b * d)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
print(max(a*c,b*c,a*d,b*d,0))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int,input().split())

if a == c and b == d:
    print(max(a*c, b*d))
    exit()
else:
    if a > 0 and b > 0:
        if c > 0 and d > 0:
            print(b*d)
        elif c <= 0 and d <= 0:
            print(a*d)
    else:
        if c > 0 and d > 0:
            print(b*c)
        else:
            print(a*c)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())

if a >= 0 and c >= 0:
  print(b*d)
elif b <= 0 and d <= 0:
  print(a*c)
elif a < 0 and c < 0:
  if b<=0 or d<=0:
    print(a*c)  
  elif abs(a)>=abs(b) and abs(c)>=abs(d):
    print(a*c)
  else:
    print(b*d)
elif (b<0 and c>=0):
  print(b*c)
elif (a>=0 and d<0):
  print(a*d)
else:
  print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
x,y,r=[],[],[]
for i in range(a,b+1):
    x.append(i)
for i in range(c,d+1):
    y.append(i)
print(x)
print(y)
for i in x:
    for j in y:
        r.append(i*j)
print(max(r))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
xmx = max([a, b])
xmin = min([a, b])
#xabsmx = max([a, b], key = abs)
#xabsmin = min([a, b],key = abs)
ymx = max([c, d])
ymin = min([c, d])
#yabsmx = max([c,d], key = abs)
#yabsmin = min([c, d],key = abs)
if xmin >= 0:#all X plus
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

elif xmx <= 0:#all X minas
    if ymin >= 0:#all Y plus
        print(xmx * ymin)
    else:
        print(xmin * ymin)
else:#X plus and minas
    if ymx <= 0:#all Y minas
        print(xmin * ymin)
    elif ymin <= 0:#all Y plus
        print(xmx * ymx)
    else:#Y plus and minas
        if xmx * ymx > xmin * ymin:
            print(xmx * ymx)
        else:
            print(xmin * ymin)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if a<0 and c<0 :
  if b>=0 and d>=0:
    if a*c >= b*d:
      print(a*c)
    else:
      print(b*d)
elif a>=0 and d<0:
  print(a*d)
elif b<0 and d<0:
  print(a*c)
else:
  print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = (int(x) for x in input().split())
if b and d >= 0:
    if a*c > b*d :
        print(a*c)
    else:
        print(b+d)
elif b >=0 and d < 0:
    if a*d > b*c :
        print(a*d)
    else:
        print(b*c)
elif b <0 and d >= 0:
    if a*d > b*c :
        print(a*d)
    else:
        print(b*c)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b<0 and c<0:
    print(a*c)
elif b<0 and d==0:
    print(b*c)
elif b<0 and c>0:
     print(b*c)
elif b==0 and d<0:
    print(a*d)
elif b==0 and d==0:
    print(a*c)
elif b==0 and c>0:
     print(b*c)
elif a>0 and d<0:
    print(a*d)
elif a>0 and d==0:
    print(a*d)
elif a>0 and d>0:
    print(a*d)

Submission status: Wrong Answer

Solution code:
li=list(map(int,input().split()))

if (li[0] or li[1])>0:
  if (li[2] or li[3])>0:
    x=max(li[0],li[1])
    y=max(li[2],li[3])
    print(x*y)
  else:
    x=min(li[0],li[1])
    y=max(li[2],li[3])
    print(x*y)
else:
  if (li[2] or li[3])>0:
    x=max(li[0],li[1])
    y=min(li[2],li[3])
    print(x*y)
  else:
    x=min(li[0],li[1])
    y=min(li[2],li[3])
    print(x*y)

Submission status: Wrong Answer

Solution code:
a,b,c,d=list(map(int,input().split()))
if a>=0 and c>=0:
    one=b
    two=d

elif b<=0 and d<=0:
    one=a
    two=c

elif a>=0 and d<=0:
    one=a
    two=d
elif b<=0 and c>=0:
    one=b
    two=c
else:
    one=b
    two=d


print(one*two)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
m=a*c
if(a>0 and b>0 and c>0 and d>0):
  m=b*d
elif(a<0 and b<0 and c<0 and d<0):
  m=a*c
elif(a<0 and b<0 and c>0 and d>0):
  m=b*c
elif(a>0 and b>0 and c<0 and d<0):
  m=a*d
elif(a<0 and b>0 and c<0 and d>0):
  max=a*c
print(m)

Submission status: Wrong Answer

Solution code:
a,b,c,d = list(map(int,input().split()))


ans = 0
if a >= 0:
    if c >= 0:
        ans = max(a*c,b * d)
    elif c <= 0 and 0 <= d:
        ans = b * d
    elif d <= 0:
        ans =  max(a*d,b * c)
elif a <= 0 and 0 <= b:
    if c >= 0:
        ans = b * d
    elif  c <= 0 and 0 <= d:
        ans = max(a*c,b*d)
    elif d <= 0 :
        ans = a * d
elif b <= 0:
    if d <= 0:
        ans = max(b * d, a * c)
    elif c <= 0 and 0 <= d:
        ans = a * c
    elif 0 <= c :
        ans = max(a*d,b * c)

print(ans)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))

if a[0]>=0 and a[2]>=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[1]*a[3])

elif a[1]<=0 and a[3]<=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[2])

elif a[1]<=0 and a[2]>=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[2])

elif a[0]>=0 and a[3]<=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[3])

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())

if a >= 0 and c >= 0:
  print(b*d)
elif b <= 0 and d <= 0:
  print(a*c)
elif a < 0 and c < 0:
  if b<0 or d<0:
    print(a*c)  
  elif abs(a)>=abs(b) and abs(c)>=abs(d):
    print(a*c)
  else:
    print(b*d)
elif (b<0 and c>=0):
  print(b*c)
elif (a>=0 and d<0):
  print(a*d)
else:
  print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

if a >= 0 and b>=0 :
    if c >= 0 and d>= 0:
        print(b*d)
    elif d < 0 :
        print(a*d)

if b < 0 :
    if d < 0 or (c < 0 and d >= 0):
        print("0")
    else :
        print(a*d)

if a < 0 and b>= 0 :
    if d < 0 :
        print(a*c)
    elif c >= 0 :
        print(a*b)
    else :
        if abs(a) > b :
            if abs(c) > d :
                print(a*c)
            else :
                print("0")
        else :
            print("0")

Submission status: Wrong Answer

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

a, b, c, d = map(int, input().split())

if a > 0:
    if c > 0:
        print(b*d)
    else:
        if b*c > b*d:
            print(a*c)
        else:
            print(a*d)
else:
    if c < 0:
        print(a*c)
    else:
        if a*c > a*d:
            print(b*c)
        else:
            print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if a<0 and c<0 :
  if b>=0 and d>=0:
    if a*c >= b*d:
      print(a*c)
    else:
      print(b*d)
elif a>0 and d<0:
  print(a*d)
elif b<0 and d<0:
  print(a*c)
else:
  print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
answer =0
if b < 0:
	if c < 0:
		answer = max(a*c,b*d)
	if c>=0:
		answer = max(a*c,b*d)
if b>=0:
	if a <0:
		answer = max(a*c ,b * d,0)
	if a >= 0:
		if d< 0:
			if a == 0:
				answer = 0
			else:
				answer = a*d
		if d>=0:
			answer = b*d
print(answer)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b >= 0 and d >= 0:
    print(b * d)
elif b >= 0 and d < 0:
    print(a * d)
elif b < 0 and d >= 0:
    print(b * c)
else:
    print(a * c)

Submission status: Wrong Answer

Solution code:
a,b,c,d= map(int,input().split())

if a>=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a>=0 and b>=0 and c<=0 and d<=0:
    print(a*d)
elif a>=0 and b>=0 and c<=0 and d>=0:
    print(b*d)
elif a<=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c>=0 and d>=0:
    print(b*c)
elif a<=0 and b<=0 and c<=0 and d<=0:
    print(a*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b>=0 and c<=0 and d>=0:
    x=a*c
    y=b*d
    #print(x,y)
    if x>=y:
        print(x)
    else:
        print(y)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if a*c >= b*d:
    print(a*c)
elif a*d >= b*d:
    print(a*d)
elif b*c >= b*d:
    print(b*c)
else:
    print(b*d)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))

while True:

  if a[0]>=0 and a[2]>=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
    else:
      print(a[1]*a[3])
    break

  if a[1]<=0 and a[3]<=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
    else:
      print(a[0]*a[2])
    break

  if a[1]<=0 and a[2]>=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
    else:
      print(a[0]*a[2])
    break

  if a[0]>=0 and a[3]<=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
    else:
      print(a[0]*a[3])
    break

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
xmx = max([a, b])
xmin = min([a, b])
#xabsmx = max([a, b], key = abs)
#xabsmin = min([a, b],key = abs)
ymx = max([c, d])
ymin = min([c, d])
#yabsmx = max([c,d], key = abs)
#yabsmin = min([c, d],key = abs)
if xmin >= 0:#all X plus
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

elif xmx <= 0:#all X minas
    if ymin >= 0:#all Y plus
        print(xmx * ymin)
    else:
        print(xmin * ymin)
else:#X plus and minas
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    elif ymin <= 0:#all Y plus
        print(xmx * ymx)
    else:#Y plus and minas
        if xmx * ymx > xmin * ymin:
            print(xmx * ymx)
        else:
            print(xmin * ymin)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

n = [[a,b],[c,d]]

result = -(10**9)
for i in range(2):
    for j in range(2):
        ans = n[0][i]*n[1][j]
        result = max(result,ans)


print(result)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if abs(a)<=abs(b) and abs(c)<=abs(d):
    print(b*d)
elif abs(a)>=abs(b) and abs(c)<=abs(d):
    print(b*c)
elif abs(a)<=abs(b) and abs(c)>=abs(d):
    print(a*d)
else:
    print(a*c)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if d<0<b:
  print(d*a)
elif b<0<d:
  print(b*c)
elif b>=0:
  print(b*d)
elif d<0:
  print(a*c)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
a,b,c,d= map(int,input().split())

if a>=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a>=0 and b>=0 and c<=0 and d<=0:
    print(a*d)
elif a>=0 and b>=0 and c<=0 and d>=0:
    print(b*d)
elif a<=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c>=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c<=0 and d<=0:
    print(a*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b>=0 and c<=0 and d>=0:
    x=a*c
    y=b*d
    #print(x,y)
    if x>=y:
        print(x)
    else:
        print(y)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))

while True:

  if a[0]>=0 and a[2]>=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
      break
    else:
      print(a[1]*a[3])

  if a[1]<=0 and a[3]<=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
      break
    else:
      print(a[0]*a[2])

  if a[1]<=0 and a[2]>=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
      break
    else:
      print(a[0]*a[2])

  if a[0]>=0 and a[3]<=0:
    if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
      print(0)
      break
    else:
      print(a[0]*a[3])

Submission status: Wrong Answer

Solution code:
a,b,c,d = list(map(int,input().split()))


ans = 0
if a >= 0:
    if c >= 0:
        ans = b * d
    elif c <= 0 and 0 <= d:
        ans = b * d
    elif d <= 0:
        ans =  max(a*d,b * c)
elif a <= 0 and 0 <= b:
    if c >= 0:
        ans = b * d
    elif  c <= 0 and 0 <= d:
        ans = max(a*c,b*d)
    elif d <= 0 :
        ans = a * d
elif b <= 0:
    if d <= 0:
        ans = a * c
    elif c <= 0 and 0 <= d:
        ans = a * c
    elif 0 <= c :
        ans = b * c

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
answer =0
if b < 0:
	if c < 0:
		answer = a*c
	if c>=0:
		answer = a * c
if b>=0:
	if a <0:
		answer = max(a*c ,b * d,0)
	if a >= 0:
		if d< 0:
			if a == 0:
				answer = 0
			else:
				answer = a*d
		if d>=0:
			answer = b*d
print(answer)

Submission status: Wrong Answer

Solution code:
import numpy as np
li= list(map(int,input().split()))
li_s= list(map(np.sign,li))

if li_s[0]==li_s[1] and li_s[2]==li_s[3] and li_s[0]*li_s[2]==-1:
    print(li[1]*li[2])
else:
    print(max(li[0]*li[2],li[1]*li[3]))

Submission status: Wrong Answer

Solution code:
lists = list(map(int,input().split()))
lists.sort()
a = lists[0]
b = lists[1]
c = lists[2]
d = lists[3]
e = a*b
f = c*d
if a*b>=c*d:
  print(a*b)
else:
  print(c*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if 3*a*c >= (a*d+b*c+b*d):
    print(a*c)
elif 3*a*d >= (a*c+b*c+b*d):
    print(a*d)
elif 3*b*c >= (a*c+a*d+b*d):
    print(b*c)
else:
    print(b*d)

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = -1000000000
if z[0]*z[1] < 0 or z[2]*z[3] < 0:
    maxnum = 0
for i in range(2):
    for j in range(2):
        x = z[i]
        y = z[j+2]
        if maxnum < x*y:
            maxnum = x*y
print(maxnum)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if b*d>=0:
  if b>0 and d>0:
    print(b*d)
  else:
    print(a*c)
  
else:
  if b<0:
    print(b*c)
  if d<0:
    print(a*d)

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c, d = map(int, input().split())
    if b <= 0 or d <= 0:
        if b <= 0 and d <= 0:
            print(a * c)
        else:
            if a >= 0:
                print(a * d)
            else:
                print(b * c)
    elif a >= 0 or c >= 0:
        if b <= 0:
            print(b * c)
        elif d <= 0:
            print(a * d)
        else:
            print(b * d)

resolve()

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())

x = a*c

if a*c < a*d:
    x=a*d
elif a*d < b*c:
    x=b*c
elif b*c < b*d:
    x=b*d

print(x)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b <= 0 and d <= 0:
    print(c * a)

elif b > 0 and d > 0:
    print(b * d)

elif b < 0 and d > 0:
    if c > 0:
        print(c * b)
    else:
        print(a * c)

elif b > 0 and d < 0:
    if a > 0:
        print(a * d)
    else:
        print(a * c)

else:
    print(b * d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = list(map(int,input().split()))


ans = 0
if a >= 0:
    if c >= 0:
        ans = b * d
    elif c <= 0 and 0 <= d:
        ans = b * d
    elif d <= 0:
        ans =  max(a*d,b * c)
elif a < 0 and 0 < b:
    if c >= 0:
        ans = b * d
    elif  c <= 0 and 0 <= d:
        ans = max(a*c,b*d)
    elif d <= 0 :
        ans = a * d
elif b <= 0:
    if d <= 0:
        ans = a * c
    elif c <= 0 and 0 < d:
        ans = a * c
    elif 0 <= c :
        ans = b * c

print(ans)

Submission status: Wrong Answer

Solution code:
li = list(map(int,input().split()))

a = li[0]
b = li[1]
c = li[2]
d = li[3]

print(a,b,c,d)

ac = a * c
bc = b * c
ad = a * d
bd = b * d
result = ac
if result < bc:
    result = bc
if result < ad:
    result = ad
if result < bd:
    result = bd
if a <= 0 and 0 <= b and result < 0:
    result = 0
if c <= 0 and 0 <= d and result < 0:
    result = 0
print(result)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())

X = [a, b]
Y = [c, d]


X_minus = 0
Y_minus = 0
X_zero = 0
Y_zero = 0

for i in X:
    if i < 0:
        X_minus += 1
    elif i == 0:
        X_zero += 1
for i in Y:
    if i < 0:
        Y_minus += 1
    elif i == 0:
        Y_zero += 1

t = (X_minus, Y_minus)
z = (X_zero, Y_zero)

if z == (0,0):
    if t == (0,0) or t == (0,1) or t == (1,0) or t == (1,1) or t == (2,2):
        ans = max(X) * max(Y)
    elif t == (0, 2) or t == (2, 0):
        ans = min(X) * max(Y)
    elif t == (1, 2):
        ans = min(X) * min(Y)
    elif t == (2, 1):
        ans = min(X) * min(Y)

elif z == (1,0) or (0,1):
    if t == (0,0):
        ans = max(X) * max(Y)
    elif t == (1,0) or (0,1):
        ans = 0
    elif t == (1,1):
        ans = min(X)*min(Y)

elif z == (0,2) or (2,0) or (1,2) or (2,1) or (2,2):
    ans = 0

elif z == (1,1):
    if t == (0,0):
        ans = max(X) * max(Y)
    elif t == (1,0) or (0,1):
        ans = 0
    elif t == (1, 1):
        ans = min(X)*min(Y)


print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
if 3*a*c > (a*d+b*c+b*d):
    print(a*c)
elif 3*a*d > (a*c+b*c+b*d):
    print(a*d)
elif 3*b*c > (a*c+a*d+b*d):
    print(b*c)
else:
    print(b*d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
 
if a>=0 and c>=0:
  print(b*d)
elif b<=0 and d<=0:
  print(a*c)
elif b<=0 and c>=0:
  print(b*c)
elif a>=0 and d<=0:
  print(a*d)
elif a<=0 and b>=0 and c<=0 and d>=0:
  print(max([a*c, b*d]))
elif b<=0 and c<=0 and d>=0:
  print(a*c)
elif a<=0 and b>=0 and d<=0:
  print(a*c)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
print(max(a*c,b*d,a*d))

Submission status: Wrong Answer

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
products = np.zeros(6)
products[0] = a * b
products[1] = a * c
products[2] = a * d
products[3] = b * c
products[4] = b * d
products[5] = c * d
print(int(np.max(products)))

Submission status: Wrong Answer

Solution code:
a,b,c,d=(int(x) for x in input().split())
s = b*d
print(s)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
ans=-10**9

if  b<=0 and d<=0:
    ans=a*c
elif b>0 and d>0:
    ans=b*d
elif b>0 and d<=0:
    ans=a*d
elif b<=0 and d>0:
    ans=b*c

print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
a_1,a_2 = [],[]
a_1.append(a[0])
a_1.append(a[1])
a_2.append(a[2])
a_2.append(a[3])

print(a_1,a_2)
max_a = -(10**30)
for i in a_1:
    for l in a_2:
        if(i*l > max_a):
            max_a = i*l

print(max_a)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))

if a[0]>=0 and a[2]>=0:
  print(a[1]*a[3])

if a[1]<=0 and a[3]<=0:
  print(a[0]*a[2])

if a[1]<=0 and a[2]>=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[2])

if a[0]>=0 and a[3]<=0:
  if a[0]==0 or a[1]==0 or a[2]==0 or a[3]==0:
    print(0)
  else:
    print(a[0]*a[3])

Submission status: Wrong Answer

Solution code:
a,b,c,d=list(map(int,input().split()))
if a>=0 and c>=0:
    one=b
    two=d

elif a<0 and c<0:
    one=a
    two=c

elif a>=0 and c<0:
    one=a
    two=d
elif a<0 and c>=0:
    one=b
    two=c


print(one*two)

Submission status: Wrong Answer

Solution code:
array = input().split()

a = float(array[0])
b = float(array[1])
c = float(array[2])
d = float(array[3])

if b > 0 and d > 0:
    print("{:.0f}".format(b*d))
elif b <= 0 and d <= 0:
    print("{:.0f}".format(a*c))
elif b <= 0 and d > 0:
    print("{:.0f}".format(b * c))
elif b > 0 and d <= 0:
    print("{:.0f}".format(a * d))

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if (a>0 and d<0) or (b<0 and c>0):
  print(max(a*c,a*d,c*b))
else:
  print(max(0,a*c,a*d,c*b))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b<0 and d<0:
    print(b*d)
elif b<0 and d==0:
    print(b*c)
elif b<0 and c>0:
     print(b*c)
elif b==0 and d<0:
    print(a*d)
elif b==0 and d==0:
    print(a*c)
elif b==0 and c>0:
     print(b*c)
elif b>0 and d<0:
    print(a*d)
elif b>0 and d==0:
    print(b*d)
elif b>0 and d>0:
    print(b*d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
xmx = max([a, b])
xmin = min([a, b])
#xabsmx = max([a, b], key = abs)
#xabsmin = min([a, b],key = abs)
ymx = max([c, d])
ymin = min([c, d])
#yabsmx = max([c,d], key = abs)
#yabsmin = min([c, d],key = abs)
if xmin >= 0:#all X plus
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

elif xmx <= 0:#all X minas
    if ymin >= 0:#all Y plus
        print(xmx * ymin)
    else:
        print(xmin * ymin)
else:#X plus and minas
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = -1000000000
for i in range(2):
    for j in range(2):
        x = z[i]
        y = z[j+2]
        if maxnum < x*y:
            maxnum = x*y
print(maxnum)

Submission status: Wrong Answer

Solution code:
i = list(map(int,input().split()))
a = i[0]
b = i[1]
c = i[2]
d = i[3]

ret = 0
if b < 0:
    if d < 0: #-2 -1 -3 -2
        ret = a * c
    elif c < 0 and d >= 0: # -3 -2 -4 0, -3 -2 -2 2
        ret = a * c
    else: # -3 -2 0 3, -3 -2 3 9
        ret = b * c
elif a < 0 and b >= 0:
    if d < 0:
        ret = a * d
    elif c < 0 and d >= 0:
        ret = max(a*c, b*d)
    else:
        ret = b * d
else:
    if d < 0:
        ret = a * d
    elif c < 0 and d >= 0:
        ret = b * d
    else:
        ret = b * d

print(ret)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b <= 0 and d <= 0:
    print(c * a)

elif b > 0 and d > 0:
    print(b * d)

elif b < 0 and d > 0:
    if c > 0:
        print(c * b)
    else:
        print(a * c)

elif b > 0 and d < 0:
    if a > 0:
        print(a * d)
    else:
        print(a * c)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))

if a[0] > 0:
	if a[3] < 0:
		print(a[0] * a[3])
	else:
		print(a[1] * a[3])

elif a[1] < 0:
	if a[2] < 0:
		print(a[0] * a[2])
else:
	if a[3] < 0:
		print(a[0] * a[2])
	elif a[2] > 0:
		print(a[1] * a[3])
	else:
		if a[0] * a[2] > a[1] * a[3]:
			print(a[0] * a[2])
		else:
			print(a[1] * a[3])

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c, d = list(map(int, input().split()))
    ans = -10 ** 10

    for x in (a, b):
        for y in (c, d):
            ans = max(ans, x * y)

    print(ans)

resolve()

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    if (b >= 0 and c >= 0):
        print(b*d)
    elif (b >= 0 and c < 0 and d >= 0):
        print(a*c)
    elif (b <= 0 and c >= 0):
        print(b*c)
    elif (b <= 0 and c < 0 and d >= 0):
        print(a*c)
    elif (d >= 0 and a >= 0):
        print(b*d)
    elif (d >= 0 and a < 0 and b >= 0):
        print(a*c)
    elif (d <= 0 and a >= 0):
        print(a*d)
    elif (d <= 0 and a < 0 and b >= 0):
        print(a*c)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

if a >= 0 and b>=0 :
    if c >= 0 and d>= 0:
        print(b*d)
    elif d < 0 :
        print(a*d)

if b < 0 :
    if d < 0 or (c < 0 and d >= 0):
        print(a*c)
    else :
        print(a*d)

if a < 0 and b>= 0 :
    if d < 0 :
        print(a*c)
    elif c >= 0 :
        print(b * d)
    else :
        if abs(a) > b :
            if abs(c) > d :
                print(a*c)
            else :
                print(b*d)
        else :
            print(b*d)

Submission status: Wrong Answer

Solution code:
import sys
from itertools import combinations
input = sys.stdin.readline

a,b,c,d = map(int,input().split())
h = []
h.append(a)
h.append(b)
h.append(c)
h.append(d)

li = list(combinations(h,2))
answer = -10000000001
for i in li:
    answer = max(answer,i[0]*i[1])
print(answer)

Submission status: Wrong Answer

Solution code:
a,b,c,d = (int(x) for x in input().split())

if a*b==0 or c*d==0:
    print(0)
elif a*b<=0 and c*d<=0:
    if a*c > b*d:
        print(a*c)
    else:
        print(b*d)
    # print("-+-+")
elif b*d>=0:
    # print("b:d>0")
    print(b*d)
elif b<0:
    # print("b<0")
    print(b*c)
else:
    # print("b>0")
    print(a*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if (a<=0 and b<=0) and (c<=0 and d<=0):
    print(a*c)
elif (a<=0 and b<=0) and (c<=0 and d>=0):
    print(a*c)
elif (a<=0 and b<=0) and (c>=0 and d>=0):
    print(max(a*c,b*d,a*d,b*c))
elif (a<=0 and b>=0) and (c<=0 and d<=0):
    print(a*c)
elif (a>=0 and b>=0) and (c<=0 and d<=0):
    print(max(a*c,b*d,a*d,b*c))
elif (a>=0 and b>=0) and (c>=0 and d>=0):
    print(b*d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())

if(a >= 0 and d <= 0):
    print(a*d)
elif(a >= 0 and c >= 0):
    print(b*d)
elif(b <= 0 and d <= 0):
    print(a*c)
elif(b*c < b*d):
    print(b*d)
elif(b*c > b*d):
    print(b*c)
elif(a*c > a*d):
    print(a*c)
else:
    print(a*d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
xmx = max([a, b])
xmin = min([a, b])
#xabsmx = max([a, b], key = abs)
#xabsmin = min([a, b],key = abs)
ymx = max([c, d])
ymin = min([c, d])
#yabsmx = max([c,d], key = abs)
#yabsmin = min([c, d],key = abs)
if xmin >= 0:#all X plus
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

if xmx <= 0:#all X minas
    if ymin >= 0:#all Y plus
        print(xmx * ymin)
    else:
        print(xmin * ymin)
else:#X plus and minas
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)