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())
ans=-10**18
if a>=0:
    if c>=0:
        print(b*d)
    elif c<0 and d>=0:
        print(b*d)
    else:
        print(a*d)
elif a<0 and b>=0:
    if c>=0:
        print(b*d)
    elif c<0 and d>=0:
        print(max(a*c,b*d))
    else:
        print(a*c)
else:
    if c>=0:
        print(b*c)
    elif 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 b <= 0 and d <= 0:
  print(a*c)
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 and a <= 0 and c <= 0:
    e = b*d
    f = a*c
    if e > f:
        print(e)
    else:
        print(f)
else:
    e = abs(a)
    f = abs(b)
    g = abs(c)
    h = abs(d)
    l = [e,f,g,h]
    l.sort()
    print(-1*l[0]*l[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=[int(_) for _ in input().split()]
if a<0 or b<0 or c<0 or d<0:
    print(min(a,b)*max(c,d))
else:
    print(max(a,b)*max(c,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(b*d)
else:
    print(a*c)

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

Submission status: Wrong Answer

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

ans = max(a*b, a*c, a*d, b*c, b*d, c*d)
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
if b > 0 and d > 0:
  ans = b*d
elif b <= 0 and d <= 0:
  ans = a*c
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:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a,b,c,d = inpm()

ans = 0
if (b <= 0 and d > 0) or (b > 0 and d <= 0):
    ans = min(abs(a),abs(b)) * min(abs(c),abs(d)) * -1
else:
    ans = max(abs(a),abs(b)) * max(abs(c),abs(d))
print(ans)

Submission status: Wrong Answer

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

minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)

if maxx >= 0 and maxy >= 0 or minx < 0 and miny < 0:
    print(max(miny * minx, maxx * maxy))
elif maxx > 0:
    print(minx * maxy)
else:
    print(maxy * minx)

Submission status: Wrong Answer

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

a,b,c,d=input2()
x=[a,b]
y=[c,d]
ans=a*b
for i in x:
	for j in y:
		if i*j > ans:
			ans=i*j
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    if a >= 0:
        if b >= 0:
            if c >= 0:
                return b * d
            
            if d >= 0:
                return max(a*c, b*d)
            return a * d
    else:
        if b >= 0:
            if c >= 0:
                return b * d
            if d >= 0:
                return max(a*c, b*d)
            return a * d
        if c >= 0:
            return b * c
        if d >= 0:
            return b * c
        return a * c

if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

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

a,b,c,d = map(int,input().split())
answer = -10000000001
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 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:
    print(b*d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(2):
  for j in range(2,4):
    if i == 0:
      ans = arr[i]*arr[j]
    else:
      ans = max(ans, arr[i]*arr[j])
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = max(a*b, a*c, a*d, b*c, b*d, c+d)
  
print(ans)

Submission status: Wrong Answer

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

if 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
else:
    ans = a * c
print(ans)

Submission status: Wrong Answer

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

print(max(a*c,b*d,b*c,a*d,0))

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
ans = []
for i in c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*i)

print(max(ans))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import itertools

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

l1 = [a, b]
l2 = [c, d]

p = itertools.product(l1, l2)

max_num = 0

for e1, e2 in p:
    max_num = max(max_num, e1*e2)
print(max_num)

Submission status: Wrong Answer

Solution code:
s = input().split()
x_min = int(s[0])
x_max = int(s[1])

y_min = int(s[2])
y_max = int(s[3])


max_value=0

for x in range(x_min,x_max+1):
  for y in range(y_min,y_max+1):
    if(x*y > max_value):
      max_value = x*y
      
print(max_value)

Submission status: Wrong Answer

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


p = [ abs(i[0]), abs(i[1]) ]
q = [ abs(i[2]), abs(i[3]) ]

print(max(p)*max(q))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
res1 = a*c
res2 = a*d
res3 = b*c
res4 = c*d

x =[]
y =[]
z =[]
l =[]

x.append(res1)
y.append(res2)
z.append(res3)
l.append(res4)

res0 = x+y+z+l

m = max(res0)

print(m)

Submission status: Wrong Answer

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
max = -999999
x = [a,b]
y = [c,d]
for i in x:
    for j in y:
        if i*j > max:
            max = i*j
print(max)

Submission status: Wrong Answer

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

x_max = max(a, b)
x_min = min(a, b)

y_max = max(c, d)
y_min = min(c, d)

print(max(x_max * y_max, x_max * x_min, x_min * y_max, x_min * y_min))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,C,D=map(int,input().split())

ans=max(A*C,B*C,A*C,A*D)
print(ans)

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=a

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

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

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

Submission status: Wrong Answer

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

if b > 0 and d > 0:
    print(max(b*d, a*c))
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:
#!/usr/bin/env python3
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif a<0 and c>=0:
    print(b*c)
elif a>=0 and c<0:
    print(a*d)
else:
    print(a*c)

Submission status: Wrong Answer

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

a,b,c,d=input2()
x=[a,b]
y=[c,d]
ans=-10**9-1
for i in x:
	for j in y:
		if i*j > ans:
			ans=i*j
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
readline = stdin.readline
# read = stdin.read
def i_input(): return int(readline().rstrip())
def i_map(): return map(int, readline().rstrip().split())
def i_list(): return list(i_map())

def main():
    A, B, C, D = i_map()
    if B <= 0 and D <= 0:
        ans = A * C
    elif B <=0 and C <= 0:
        ans = B * C
    elif A <= 0 and D <= 0:
        ans = A * D
    elif B <= 0:
        ans = B * C
    elif D <= 0:
        ans = A * D
    else:
        ans = B * D
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    A, B, C, D = [int(i) for i in input().split()]
    if A >= 0:
        if D <= 0:
            print(A * D)
        else:
            print(B * D)
    elif B <= 0:
        if C >= 0:
            print(B * C)
        else:
            print(A * C)
    else:
        if C >= 0:
            print(B * D)
        elif D <= 0:
            print(0)
        else:
            print(max(A * C, B * D))



if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
ans = []
for i in b,c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*i)
ans.append(c*d)

print(max(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, open(0).read().split())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,C,D = map(int, input().split())

ans = -(10 ** 9) -1

ans = max(ans,A * C) 
ans = max(ans,A * D) 
ans = max(ans,B * C) 
ans = max(ans,B * D) 

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ac = a * c
bc = b * c
ad = a * d
bd = b * d
result = ac
if result < bc:
    result = bc
elif result < ad:
    result = ad
elif result < bd:
    result = bd

print(result)

Submission status: Wrong Answer

Solution code:
L = list(map(int, input().split()))
X = L[:2]
Y = L[2:]

# ans = 0
ans_max = -10**9

for x in X:
    for y in Y:
        ans = x * y
        if ans > ans_max:
            ans_max = ans
print(ans_max)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
arr = list(map(int,input().split()))
ans = 0

for i in range(2):
  for j in range(2,4):
    ans = max(ans, arr[i]*arr[j])
  
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)
    exit()
elif(b==0):
    if(c>0):
        print(0)
        exit()
    else:
        print(a*c)
        exit()
elif(d==0):
    if(a>0):
        print(0)
        exit()
    else:
        print(a*c)
        exit()
elif(b>0 and d<0):
    print(a*d)
    exit()
elif(d>0 and b<0):
    print(b*c)
    exit()
else:
    print(a*c)
    exit()

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(x) for x in input().split()]
m1 = max(a,b)
m2 = max(c,d)
if(m1<=0 and m2<=0):
  print(min(a,b)*min(c,d))
elif(m1>0 and m2<=0):
  print(min(a,b)*m2)
elif(m1<=0 and m2>0):
  print(m1*min(c,d))
else:
  print(m1*m2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

input_line = input().split(" ")
a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
d = int(input_line[3])

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

Submission status: Wrong Answer

Solution code:
listA=list(map(int,input().split()))
print(listA)
x_list = []
for i in [0,1]:
    x_list.append(listA[i])

y_list = []
for i in [2,3]:
    y_list.append(listA[i])

i_list = []
for x in x_list:
    for y in y_list:
        i_list.append(x*y)

print(max(i_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    max_val = -10**10

    for i in [a,b]:
        for j in [c,d]:
            max_val = max(max_val,i*j)
    
    print(max_val)

solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ac = a * c
bc = b * c
ad = a * d
bd = a * d
result = ac
if result < bc:
    result = bc
elif result < ad:
    result = ad
elif result < bd:
    result = bd
elif a < 0 and 0 < b and result < 0:
    result = 0
elif 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())

minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)

if maxx >= 0 and maxy >= 0:
    print(maxx * maxy)
elif maxx < 0 and maxy < 0:
    print(minx * miny)
elif maxx > 0:
    print(minx * maxy)
else:
    print(maxy * minx)

Submission status: Wrong Answer

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

a,b,c,d = map(int,input().split())
answer = -10000000001
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())

mx = - (1 << 30)

mx = max(a * c, mx)
mx = max(a * d, mx)
mx = max(b * c, mx)
mx = max(b * d, mx)

print(mx)

Submission status: Wrong Answer

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

_list_multi = [_list[0]*_list[2], _list[0]*_list[3], _list[1]*_list[2], _list[1]*_list[3]]
print(max(_list_multi))

Submission status: Wrong Answer

Solution code:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*c)
list1.sort()
print(list1[3])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if b>0 & d>0:
  print(int(b*d))
  
elif b<0 & d<0:
  print(int(a*c))

elif  a>0 & d<0:
  print(int(a*d))
  
else:
  print(int(b*c))

Submission status: Wrong Answer

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

maximum = -2*10**9
for i in range(2):
    for j in range(2,4):
        maximum = max(maximum,A[i]*A[j])

# if (maximum<0):
#     if (A[0]*A[1]<=0)|(A[2]*A[3]<=0):maximum=0
print(maximum)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
ans = 0
if b<=0 and d<=0:
    ans = a*c
elif a>=0 and c>=0:
    ans = b*d
elif b<=0 and c>=0:
    ans = b*c
elif a>=0 and d<=0:
    ans = a*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 * 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:
# coding: utf-8
# Your code here!

input_line = input().split(" ")
a = int(input_line[0])
b = int(input_line[1])
c = int(input_line[2])
d = int(input_line[3])

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

Submission status: Wrong Answer

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

ans1 = a*c
ans2 = b*d

if ans1 > ans2:
    print(ans1)
else:
    print(ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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:
    e = abs(a)
    f = abs(b)
    g = abs(c)
    h = abs(d)
    l = [e,f,g,h]
    l.sort()
    print(-1*l[0]*l[1])

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())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

#N = int(input())
A = list(map(int, input().split()))
B = list()
for i in range(4):
    for j in range(4):
        if i==j:
            break
        B.append(A[i]*A[j])

print('{}'.format(max(B)))

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(x) for x in input().split()]
m1 = max(a,b)
m2 = max(c,d)
if(m1<0 and m2<0):
  print(min(a,b)*min(c,d))
elif(m1>0 and m2<0):
  print(min(a,b)*m2)
elif(m1<0 and m2>0):
  print(m1*min(c,d))
elif(m1==0 and m2==0):
  print(min(a,b)*min(c,d))
else:
  print(m1*m2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if abs(a)<abs(b):
  cc=a
  a=b
  b=cc

if abs(c)<abs(d):
  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())

ans = -(10 ** 9)

ans = max(ans,A * C) 
ans = max(ans,A * D) 
ans = max(ans,B * C) 
ans = max(ans,B * D) 

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
list1=[a,b]
list2=[c,d]
ans=-1*10**10
tmp=0
for i in list1:
    for j in list2:
        tmp=i*j
        if ans<tmp:
            ans=tmp
print(ans)

Submission status: Wrong Answer

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

max = a[0]*a[2]
if max < a[0]*a[3]:
    max = a[0]*a[3]
if max < a[1]*a[2]:
    max = a[1]*a[2]
if max < a[1]*a[3]:
    max < a[1]*a[3]

print(max)