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

list = []
list2 =[]

list.append(a)
list.append(b)
list2.append(c)
list2.append(d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
x = range(a,b+1)
y = range(c,d+1)

for i in x and y:
  if max(x) < 0 and max(y) >= 0:
    print(max(x)*min(y))
  elif max(x) >= 0 and max(y) <= 0:
    print(min(x)*max(y))
  else:
    print(max(x)*max(y))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

def a():
    x = int(input())
    if x == 0:
        print(1)
    else:
        print(0)


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

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



def c():
    pass



def d():
    pass


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if b>0 and d>0:

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

    one=a
    two=c
else:
    if b>0:

        one=a
        two=d
    else:

        one=b
        two=c

print(one*two)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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=list(map(int,input().split()))

if b>0 and d>0:
    print(100)
    one=b
    two=c
elif b>=0 and d>=0:
    print(200)
    one=a
    two=c
else:
    if b>0:
        print(300)
        one=a
        two=d
    else:
        print(400)
        one=b
        two=c

print(one*two)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nums=[int(e) for e in input().split()]
if nums[0]>=0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
    if abs(nums[0])>abs(nums[1]) and abs(nums[2])>abs(nums[3]):
        print(nums[0]*nums[2])
    else:
        print(nums[1]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]>=0:
    print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[2])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = z[0]*z[2]
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]
        prod = x*y
    if prod > maxnum:
        maxnum = prod
print(maxnum)

Submission status: Wrong Answer

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

if num[0] > 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(num[1] * num[3])
  else:
    print(num[1] * num[3])
elif num[2] <= 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(max(num[0] * num[2], num[1] * num[3]))
  else:
    print(num[0] * num[2])
else:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[2])
  elif num[2] <= 0 and num[3] > 0:
    print(num[1] * num[2])
  else:
    print(num[0] * num[2])

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
max = -10 ** 11
for i in range(2):
  for j in range(2,4):
    p = a[i] * a[j]
    if max < p:
      max = p
print(max)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def product(x) :  
      
    prod = 1
    while (x) : 
        prod *= (x % 10)  
        x //= 10;  
      
    return prod 
  
# This function returns the number having  
# maximum product of the digits  
def findNumber(l, r) : 
      
    # Converting both integers to strings  
    a = str(l);  
    b = str(r);  
  
    # Let the current answer be r  
    ans = r 
      
    for i in range(len(b)) :  
        if (b[i] == '0') :  
            continue
  
        # Stores the current number having  
        # current digit one less than current  
        # digit in b  
        curr = list(b) 
        curr[i] = str(((ord(curr[i]) - 
                        ord('0')) - 1) + ord('0')) 
  
        # Replace all following digits with 9  
        # to maximise the product  
        for j in range(i + 1, len(curr)) : 
            curr[j] = str(ord('9')) 
              
        # Convert string to number  
        num = 0
        for c in curr : 
            num = num * 10 + (int(c) - ord('0'))  
  
        # Check if it lies in range and its 
        # product is greater than max product  
        if (num >= l and product(ans) < product(num)) : 
            ans = num 
  
    return ans 
  
# Driver Code  
if __name__ == "__main__" : 
      
    l, r = 1, 10
    print(findNumber(l, r)) 
  
    l, r = 51, 62
    print(findNumber(l, r))

Submission status: Wrong Answer

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

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 = list(map(int,input().split()))
max = -10 ** 11
for i in range(2):
  for j in range(2,4):
    p = a[i] * a[j]
    #print(p)
    if abs(max) < abs(p) and 0 < p:
      max = p
    elif abs(p) < abs(max) and 0 > p:
      max = p
print(max)

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 b > 0 and d < 0:
  print(a*d)
  
elif 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 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 and d < 0:
    print(a*c)
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:
# B 
z = list(map(int, input().split(" ")))
maxnum = z[0]*z[2]
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]
        prod = x*y
    if maxnum < prod:
        maxnum = prod
print(maxnum)

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

Submission status: Wrong Answer

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

#Xが正
if l[0] > 0:
    #yも正
    if l[2] > 0:
        print(l[1] * l[3])
    #yが負(1)
    if l[3] <= 0:
        print(l[0] * l[3])
    #(2)
    if l[2] < 0 and l[3] > 0:
        print(l[1] * l[3])

#yが正
if l[2] > 0:
    #yも正
    #if l[0] > 0:
        #print(l[1] * l[3])
    #yが負(a,b)
    if l[1] <= 0:
        print(l[1] * l[2])
    #(2)(aのみ)
    if l[0] < 0 and l[1] > 0:
        print(l[1] * l[3])

#両方負
if l[1] <= 0 and l[3] <= 0:
    print(l[0] * l[2])

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

Submission status: Wrong Answer

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

if a>0:
    if d<0:
        M=a*d
    else:
        M=b*d

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

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

Submission status: Wrong Answer

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

ans = -10**9
ans = max(ans, a*c, a*d, b*c, b*d)

print(ans)

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

elif a[1]<=0 and a[3]<=0:
  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*c >= b*d:
    if a*c >= a*d:
        if a*c >= b*c:
            print(a*c)
elif a*d >= b*d:
    if a*d >= b*c:
        print(a*d)
elif b*c >= b*d:
    print(b*c)
else:
    print(b*d)

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = -100000000000000000000
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=list(map(int,input().split()))

if a[0]>=0 and a[2]>=0:
  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())

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

Submission status: Wrong Answer

Solution code:
nums=[int(e) for e in input().split()]
if nums[0]>=0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]>=0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[3])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]>=0:
    print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]>=0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]>=0 and nums[3]>=0:
    print(nums[1]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]>=0:
    print(nums[0]*nums[2])
elif nums[0]<0 and nums[1]<0 and nums[2]<0 and nums[3]<0:
    print(nums[0]*nums[2])

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = -1000000000000000000
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:
num = list(map(int, input().split()))

if num[0] > 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(num[1] * num[3])
  else:
    print(num[1] * num[3])
elif num[2] <= 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(max(num[0] * num[2], num[1] * num[3]))
  else:
    print(num[0] * num[2])
else:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[2])
  elif num[2] <= 0 and num[3] > 0:
    print(num[0] * num[2])
  else:
    print(num[0] * num[2])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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 a*d > max:
    max = a*d
elif b*c > max:
    max = b * c
elif b * d > max:
    max = b*d

print(max)

Submission status: Wrong Answer

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

if a>=0 and c>=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())

f=1
g=1 
ans=1
if b<=0:
    f=0
if d<=0:
    g=0
if f+g==0:
    ans=a*c
elif f==0:
    ans=b*c
elif g==0:
    ans=a*d
else:
    ans=b*d
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
A = (a*c)
B = (a*d)  
C = (b*c)
D = (c*d)
MAX = A

if MAX < B:
    MAX = B
elif MAX < C:
    MAX = C
elif MAX < D:
    MAX = D

print(MAX)

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

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 numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline


def array(size, init=0):
    return [[init for j in range(size[1])] for i in range(size[0])]


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


def II():
    return int(input())


def nitti(x, y):
    count = 0
    for i in range(len(x)):
        if x[i] == y[i]:
            count += 1
    return count


x = acinput()


res = 10**8*(-1)

for i in range(2):
    for j in range(2, 4):
        res = max(res, x[i]*x[j])

print(res)

Submission status: Wrong Answer

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

if a>0:
    if d<0:
        M=a*d
    else:
        M=b*d

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

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

Submission status: Wrong Answer

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

f=1
g=1 
ans=1
if b<0:
    f=0
if d<0:
    g=0
if f+g==0:
    ans=a*c
elif f==0:
    ans=b*c
elif g==0:
    ans=a*d
else:
    ans=b*d
print(ans)

Submission status: Wrong Answer

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

ans = -10**9
ans1 = 0
ans2 = 0
boolian1 = False
boolian2 = False

if a <= b:
    if 0 < b <= d:
        ans1 = b*d
        boolian1 = True
    if a <= c < 0:
        ans2 = a*c
        boolian2 = True
    if boolian1 or boolian2 == True:
        print(max(ans1,ans2))
        exit()
    for x in range(a,b+1):
        for y in range(c,d+1):
            product = x * y
            ans = max(ans,product)
if a > b:
    if 0 <= c <= d:
        ans1 = c*d
        boolian1 = True
    if a < b < 0 :
        ans2 = a*b
        boolian2 = True
    if boolian1 or boolian2 == True:
        print(max(ans1,ans2))
        exit()
    for x in range(a,c+1):
        for y in range(b,d+1):
            product = x*y
            ans = max(ans,product)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S=list(input().split())
A=[int(n) for n in S]
if A[0]<0 and A[1]<0 and A[2]<0 and A[3]<0:
    print(A[0]*A[2])
elif A[0]<0 and A[1]<0 and A[2]<0 and A[3]>0:
    print(A[0]*A[2])
elif A[0]<0 and A[1]<0 and A[2]>0 and A[3]>0:
    print(A[1]*A[2])
elif A[0]<0 and A[1]>0 and A[2]<0 and A[3]<0:
    print(A[0]*A[2])
elif A[0]<0 and A[1]>0 and A[2]<0 and A[3]>0:
    print(max(A[0]*A[2],A[1]*A[3]))
elif A[0]<0 and A[1]>0 and A[2]>0 and A[3]>0:
    print(A[1]*A[3])
elif A[0]>0 and A[1]>0 and A[2]<0 and A[3]<0:
    print(A[0]*A[3])
elif A[0]>0 and A[1]>0 and A[2]<0 and A[3]>0:
    print(A[1]*A[3])
elif A[0]>0 and A[1]>0 and A[2]>0 and A[3]>0:
    print(A[1]*A[3])

Submission status: Wrong Answer

Solution code:
array = list(map(int, input().strip().split()))
l = len(array)
list = []
if(l==4):
	ac=array[0]*array[2]
	ad=array[0]*array[3]
	bc=array[1]*array[2]
	bd=array[1]*array[3]

	list.append(ac)
	list.append(ad)
	list.append(bc)
	list.append(bd)

	print(list)

	print(max(list))

else:
  print("")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

if abs(a) > abs(b):
  x = a
  X = b
else:
  x = b
  X = a

if abs(c) > abs(d):
  y = c
  Y = d
else:
  y = d
  Y = c

if x*y > X*Y:
  print(x*y)
else:
  print(X*Y)

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

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

print(ans)

Submission status: Wrong Answer

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

if num[0] > 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(num[1] * num[3])
  else:
    print(num[1] * num[3])
elif num[2] <= 0 and num[1] > 0:
  if num[2] > 0 and num[3] > 0:
    print(num[1] * num[3])
  elif num[2] <= 0 and num[3] > 0:
    print(max(num[0] * num[2], num[1] * num[3]))
  else:
    print(num[0] * num[3])
else:
  if num[2] > 0 and num[3] > 0:
    print(num[0] * num[2])
  elif num[2] <= 0 and num[3] > 0:
    print(num[1] * num[2])
  else:
    print(num[0] * num[2])

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

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

Submission status: Wrong Answer

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

if a>0:
    if c>=0 or d>0:
        M=b*d
    if d<=0:
        M=a*d

if a<=0:
    if b<=0:
        if d<=0:
            M=a*c
        if d>0:
            if c>=0:
                M=b*c
            if c<0:
                M=a*c
    if b>0:
        if d<=0:
            M=a*c
        if d>0:
            M=b*d

print(M)