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 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*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:
    if abs(a*c) > b*d:
        print(abs(a*c))
    else:
        print(b*d)
#--++
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*c)

#----
elif a<0 and b<0 and c<0 and d<0:
    print(b*d)

Submission status: Wrong Answer

Solution code:
inputs = input().split()
inputs = list(map(lambda x: int(x), inputs))
x_array = [inputs[0], inputs[1]]
y_array = [inputs[2], inputs[3]]
max = -1000000000

for x in x_array:
    for y in y_array:
        if(max < x * y):
            max = x * y

print(max)

Submission status: Wrong Answer

Solution code:
L=list(map(int,input().split()))
# print(L)
ab=[L[0],L[1]]
cd=[L[2],L[3]]
ans=-(10**10)
for i in ab:
    for j in cd:
        ans=max(ans,i*j)
print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    x_list = [a, b]
    y_list = [c, d]
    ans = 0

    if x_list[0] <= 0 and x_list[1] <= 0 and y_list[0] > 0 and y_list[1] > 0:
        ans = max(x_list) * min(y_list)
    elif (x_list[0] > 0 and x_list[1] > 0 and y_list[0] <= 0 and y_list[1] <= 0):
        ans = max(y_list) * min(x_list)
    elif (x_list[0] <= 0 or x_list[1] <= 0) and (y_list[0] <= 0 or y_list[1] <= 0):
        ans = min(x_list) * min(y_list)
    else:
        ans = max(x_list) * max(y_list)

    print(ans)

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:
    print(c * b)


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

Submission status: Wrong Answer

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

if 0 <= a:
    if 0 <= c:
        ans = b*d
    elif c < 0 < d:
        ans = b*d
    elif d <= 0:
        ans = a*d
        
elif a < 0 < b:
    if 0 <= c:
        ans = a*c
    elif c < 0 < d:
        ans = max([a*c, b*d])
    elif d <= 0:
        ans = a*c
        
elif b <= 0:
    if 0 <= c:
        ans = b*c
    elif c < 0 < d:
        ans = a*c
    elif d <= 0:
        ans = a*c
        
        
print(ans)

Submission status: Wrong Answer

Solution code:
if __name__=="__main__":
  l=[int(i) for i in input().split()]
  if all(i<0 for i in l):
    print(min(l[:2])*min(l[2:]))
  elif all(i>0 for i in l):
    print(max(l[:2])*max(l[2:]))
  elif all(i!=0 for i in l) and l[0]%abs(l[0])^l[1]%abs(l[1]) and l[3]%abs(l[3])^l[2]%abs(l[2]):
    a=min(l[:2])
    b=min(l[2:])
    c=max(l[:2])
    d=max(l[:2])
    print(max(a*b,c*d))

  elif all(i<0 for i in l[:2]) and all(i>0 for i in l[2:]):
      print(max(l[:2])*min(l[2:]))
  elif  all(i<0 for i in l[2:]) and all(i>0 for i in l[:2]):
      print(min(l[:2])*max(l[2:]))
  else:
    a=min(l[:2])
    b=min(l[2:])
    c=max(l[:2])
    d=max(l[:2])
    print(max(a*b,c*d))

Submission status: Wrong Answer

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

if 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 b >= 0 and d >= 0 and a <= 0 and c <= 0:
    e = b*d
    f = a*c
    if e > f:
        print(e)
    else:
        print(f)
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 c <= 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*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(b*d)
elif a <= 0 and b >= 0 and c <= 0 and d <= 0: # - + - -
    print(a*c)

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
else:
    one=b
    two=c

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:
        ret = a * c
    elif c < 0 and d >= 0:
        ret = a * c
    else:
        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 a<0 and c<0:
    print(a*c)
elif b>=0 and d>=0:
    print(b*d)
elif b<0 and c>=0:
    print(b*c)
elif a>=0 and d<0:
    print(a*d)
else:
    if a*c>=b*d:
        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 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(b*c)
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*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 b <= 0 and d > 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 or d == 0:
    print(0)
else:
    if c < 0 and a < 0:
        print(max(abs(a),b) * max(abs(c),d))
    else:
        print(b * d)

Submission status: Wrong Answer

Solution code:

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

if b>0 and d>0:
    out=b*d

elif b<=0 and d<=0:
    out=a*c

else:
    if b>=0 and d<0:
        if a<0:
            out=a*c
        else:
            out=a*d
    else:
        if c<0:
            out=a*c
        else:
            out=b*c

print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
templist = input().split()
a = int(templist[0])
b = int(templist[1])
c = int(templist[2])
d = int(templist[3])
flg1 = 0
flg2 = 0

if b <= 0:
    flg1 = 1
if d <= 0:
    flg2 = 1
    
if flg1 == 0 and flg2 == 0:
    print(b * d)
elif flg1 == 1 and flg2 == 1:
    print(a * c)
elif flg1 == 1 and flg2 == 0:
    if b == 0 or c == 0:
        print(0)
    else:
        print(b * c)
else:
    if d == 0 or c == 0:
        print(0)
    else:
        print(a * d)

Submission status: Wrong Answer

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

if 0 <= a:
    if 0 <= c:
        ans = a*d
    elif c < 0 < d:
        ans = b*d
    elif d <= 0:
        ans = a*d
        
elif a < 0 < b:
    if 0 <= c:
        ans = a*c
    elif c < 0 < d:
        ans = max([a*c, b*d])
    elif d <= 0:
        ans = a*c
        
elif b <= 0:
    if 0 <= c:
        ans = b*c
    elif c < 0 < d:
        ans = a*c
    elif d <= 0:
        ans = a*c
        
        
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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


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

Submission status: Wrong Answer

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

if b <= 0 and d > 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 or d == 0:
    print(0)
else:
    if c < 0 and a < 0:
        print(max(abs(a),b) * max(abs(c),d))
    print(b * d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a == 0:
    a = b
if b == 0:
    b = a
if c == 0:
    c = d
if d == 0:
    d = c

if max(a, b) < 0 and max(c, d) > 0:
    A = -min(abs(a), abs(b))
    B = min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) < 0:
    A = min(abs(a), abs(b))
    B = -min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) > 0:
    A = max(abs(a), abs(b))
    B = max(abs(c), abs(d))
else:
    A = max(abs(a), abs(b))
    B = max(abs(c), abs(d))

print(A * B)

Submission status: Wrong Answer

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

print(x * y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
if b >= 0 and d >= 0:
  if abs(a) >= b and abs(c) >= d:
    print(a * c)
  else:
    print(b * d)
elif b < 0 and d < 0:
  print(a * c)
elif b < 0 and d >= 0:
  if c <= 0:
    print(0)
  else:
    print(b * c)
elif b >= 0 and d < 0:
  if a <= 0:
    print(0)
  else:
    print(a * 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)
if a >= 0 and b >= 0:
    if c <= 0 and d <= 0:
        print(a * d)
if a <= 0 and b >= 0:
    if c <= 0 and d >= 0:
        if (a-0)*(-1) >= b-0 and (c-0)*(-1) >= d-0:
            print(a * c)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
if (b<0 and d<0) or (a>0 and d<0) or (c>0 and b<0) or (a>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=(int(x) for x in 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:
  print(b*c)
elif c<0 and a>=0:
  print(a*d)

Submission status: Wrong Answer

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

l=[a,b,c,d]
xy=[]
for i in range(4):
    for j in range(i+1,4):
        xy.append(l[i]*l[j])

print(max(xy))

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 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 b <= 0 and d <= 0:
    print(a * c)
elif (b <= 0 and c >= 0) or (a >= 0 and d <= 0):
    print(-min(abs(a), abs(b)) * min(abs(c), abs(d)))
else:
    print(b * d)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

cross_list = [a*c, a*d, b*c, b*d]

cross_list.sort
print(cross_list[3])

Submission status: Wrong Answer

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

l=[a*c,a*d,b*c,b*c]

print(max(l))

Submission status: Wrong Answer

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

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(a*d)
elif(a >= 0 and c >= 0):
    print(b*d)
elif(b <= 0 and d <= 0):
    print(a*c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c,d,=map(int,input().split())
if(a<-1 and c<-1):
  x=a*c
  print(x)
else:
  y=b*d
  print(y)

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(b*d)
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(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*c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(x * y)

Submission status: Wrong Answer

Solution code:
num = input().split()
a = int(num[0])
b = int(num[1])
c = int(num[2])
d = int(num[3])
if a >= 1 and c >= 1:
  print(b * d)
elif a <= 0 and c <= 0:
  print(a * c)
elif b <= 1:
  print(b * c)
elif d <= 1:
  print(a * d)

Submission status: Wrong Answer

Solution code:

a, b, c, d = [int(x) for x in input().split()]
if b == 0 and d == 0:
  print(a * c)
if b < 0 or d < 0:
  if b < 0 and d < 0:
    print(a * c)
  else:
    print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d)))
else:
  print(b * d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = list(map(int,input().split()))
z = a*b
y = a*c
x = a*d
w = b*c
v = b*d
u = c*d
e = []
e.append(z)
e.append(y)
e.append(x)
e.append(w)
e.append(v)
e.append(u)
print(max(e))

Submission status: Wrong Answer

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

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


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

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

else:
    print(c * a)

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(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(a*c)
#負　負　負　負
elif a <= 0 and b <= 0 and c <= 0 and d <= 0:
    print(a*c)
#正　正　負　正
elif c > 0 and d > 0 and a <= 0 and b > 0:
    print(b*d)
#正　正　負　負
elif c > 0 and d > 0 and a <= 0 and b <= 0:
    print(a*d)
#負　正　負　負
elif c <= 0 and d > 0 and a <= 0 and b <= 0:
    print(a*c)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())
l = []
l.append(a*c)
l.append(a*d)
l.append(b*c)
l.append(b*d)

l.sort()
print(l)
print(max(l))

Submission status: Wrong Answer

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

if a<0 and b<0:
  cc=a
  a=b
  b=cc

if c<0 and d<0:
  cc=c
  c=d
  d=cc

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 a <= b <= 0 and c <= d <= 0:
    print(max(abs(a), abs(b)) * max(abs(c), abs(d)))

else:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

Submission status: Wrong Answer

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

if a == 0:
    a = b
if b == 0:
    b = a
if c == 0:
    c = d
if d == 0:
    d = c

if max(a, b) < 0 and max(c, d) > 0:
    A = -min(abs(a), abs(b))
    B = min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) < 0:
    A = min(abs(a), abs(b))
    B = -min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) > 0:
    A = max(abs(a), abs(b))
    B = max(abs(c), abs(d))
else:
    A = min(abs(a), abs(b))
    B = min(abs(c), abs(d))

print(A * B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
######################################################
#                                                    #
#                                                    # 
#                                                    # 
#                                                    # 
#               Coded by Prathyaksh                  # 
#                  on 12/09/2020                     # 
#                                                    #   
#                                                    # 
#                                                    # 
#                                                    #      #                                                    # 
######################################################
#Ada matrix
import math
import collections

#referenced this link for gcd functions its just a template
#https://www.geeksforgeeks.org/program-to-find-lcm-of-two-numbers/

#lol to get rid of plagiarism
def gcd(a,b):
  if a==0:
    return b
  return gcd(b%a,a)

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

def min(a,b):
  if a<b:
    return a
  else:
    return b

def sw(a,b):
  a,b=b,a

#logic starts here
#n=int(input())
a,b,c,d=(map(int,input().split()))
if a<0 and b<0 and c<0 and d<0:
  print(min(a,b)*min(c,d))
elif a>0 and b>0 and c>0 and d>0:
  print(max(a,b)*max(c,d))
elif a<0 and b<0 and c>0 and d>0:
  print(max(a,b)*min(c,d))
elif a>0 and b>0 and c<0 and d<0:
  print(max(c,d)*min(a,b))
elif a<0 and b>0 and c<0 and d>0:
  print(max((a*c),(b*d)))
elif a>0 and b<0 and c>0 and d<0:
  print(max((a*b),(c*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*d)

Submission status: Wrong Answer

Solution code:
def maxProduct(nums):
        B = nums[::-1]
        
        for x in range(1,len(nums)):
            if nums[x - 1] != 0:
                nums[x] *= nums[x - 1]
                
            if B[x - 1] != 0:
                B[x] *= B[x - 1]
        return max(nums + B)
nums=list(map(int,input().split()))
print(maxProduct(nums))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

if b < 0 or d < 0:
	if b < 0:
		x = b
	else:
		x = a

	if d < 0:
		y = d
	else:
		y = c
else:
	x = max(a, b)
	y = max(c, d)

print(x * y)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
if __name__=="__main__":
  l=[int(i) for i in input().split()]
  if all(i<0 for i in l):
    print(min(l[:2])*min(l[2:]))
  elif all(i>0 for i in l):
    print(max(l[:2])*max(l[2:]))
  elif all(i!=0 for i in l) and l[0]%abs(l[0])^l[1]%abs(l[1]) and l[3]%abs(l[3])^l[2]%abs(l[2]):
    a=min(l[:2])
    b=min(l[2:])
    c=max(l[:2])
    d=max(l[:2])
    print(max(a*b,c*d))
  else:
    a=min(l[:2])
    b=min(l[2:])
    c=max(l[:2])
    d=max(l[:2])
    print(max(a*b,c*d))

Submission status: Wrong Answer

Solution code:
li = input().split()
# li  = [3,5,-4,-2]
li1 = li[0:2]
li2 = li[2:4]
ans = -99999999999

for x in li1:
    for y in li2:
        tmp = int(x)*int(y)
        if tmp > ans:
            ans = tmp
print(ans)

Submission status: Wrong Answer

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

print(x * y)

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(x) for x in input().split()]
if b <= 0 or d <= 0:
  if b <= 0 and d <= 0:
    print(a * c)
  else:
    print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d)))
else:
  print(b * d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
g= a*c
h= b*d
q=a*d
z=b*c
w=a*d
e=b*c
r=b*c
t=a*d
if g>h:
    print(g)
elif q> z:
    print(q)
elif w>e:
    print(w)
elif r>t:
    print(r)

Submission status: Wrong Answer

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

if 0<= a and 1 <= b and 0 <= c and 1 <= d:
    print(b * d)
elif a < 0 and b <= 0 and c < 0:
    print(a * c)
elif b < 0 and 0 <= c and 1 <= d:
    print(b * c)
elif 0 <= a  and d <= 0:
    print(a * 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 a < 0 and c < 0:
    print(a*c)
else:
    x = min(abs(a),abs(b))
    y = min(abs(c),abs(d))
    print(-x*y)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    x_list = [a, b]
    y_list = [c, d]
    ans = 0

    if x_list[0] <= 0 and x_list[1] <= 0 and y_list[0] > 0 and y_list[1] > 0:
        ans = max(x_list) * min(y_list)
    elif (x_list[0] > 0 and x_list[1] > 0 and y_list[0] <= 0 and y_list[1] <= 0):
        ans = max(y_list) * min(x_list)
    elif x_list[0] <= 0 and x_list[1] <= 0 and y_list[0] <= 0 and y_list[1] <= 0:
        ans = min(x_list) * min(y_list)
    else:
        ans = max(x_list) * max(y_list)

    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 a <= b <= 0 and c <= d <= 0:
    print(max(abs(a), abs(b)) * max(abs(c), abs(d)) * -1)

else:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

Submission status: Wrong Answer

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

ab = a
cd = c
ab_flag = 0
cd_flag = 0

if abs(a) < abs(b):
    ab = b
    ab_flag = 1

if abs(c) < abs(d):
    cd = d
    cd_flag = 1

ans = ab * cd

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

print(str(ans))

Submission status: Wrong Answer

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

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:
array = input().split()

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

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())
if b*d > 0:
    print(b*d)
else:
    print(-1*min(abs(a),abs(b))*min(abs(c),abs(d)))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
p1=0;p2=0;p3=0;p4=0
if (a,b,c,d)==(0,0,0,0):
  print(0)
else:
  p1=a*c
  p2=a*d
  p3=b*c
  p4=b*d
print(max(max(p1,p2),max(p3,p4)))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
s = []
for i in [a, b]:
  s.append(c * i)
  s.append(d * i)
  s.append(0)
print(max(s))

Submission status: Wrong Answer

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

x1 = a * c
x2 = a * d
x3 = b * c
x4 = b * d

max = x1
if x2 > max:
    max = x2
elif x3 > max:
    max = x3
else:
    max = x4

print(max)