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=list(map(int, input("Enter a multiple value: ").split())) 
prod=[]

prod.append(a*c)
prod.append(a*d)
prod.append(b*c)
prod.append(b*d)

print(max(prod))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(x) for x in input().split()]
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(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(c*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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
(X1,X2,Y1,Y2)=list(map(int,input().split()))
print (X1,X2,Y1,Y2)
ans=X2*Y2
ans=max(ans,X1*Y1)
ans=max(ans,X1*Y2)
ans=max(ans,X2*Y1)
print (ans)

Submission status: Wrong Answer

Solution code:
(X1,X2,Y1,Y2)=list(map(int,input().split()))
#print (X1,X2,Y1,Y2)
ans=X2*Y2
if X1<0 and Y1 <0:
  ans=max(ans,X1*Y1)
print (ans)

Submission status: Wrong Answer

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

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

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

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
if l[1]<=0 and l[3]<=0:
	print(l[0]*l[2])
elif l[1]<0:
	print(l[1]*l[2])
elif l[3]<0:
	print(l[0]*l[3])
else:
	print(l[1]*l[3])

Submission status: Wrong Answer

Solution code:
l=list(map(int,input().split()))
if l[1]<0 and l[3]<0:
	print(l[0]*l[2])
elif l[1]<0:
	print(l[1]*l[2])
elif l[3]<0:
	print(l[0]*l[3])
else:
	print(l[1]*l[3])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=[int(x) for x in input().split()]
print(a)
b=[a[0]*a[2],a[0]*a[3],a[1]*a[2],a[1]*a[3]]
print(max(b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split(' '))
ans1 = a*c
ans2 = a*c
ans3 = b*c
ans4 = b*d

print(max(ans1,ans2,ans3,ans4))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8
a,b,c,d= map(int,input().split())
if a>0 and c>0:
    print(b*d)
if a<0 and c>0 or a>0 and c<0:
    print(a*d)
if a<=0 and c <= 0 :
    print(max(abs(a),abs(b))*max(abs(c),abs(d)))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8
a,b,c,d= map(int,input().split())
if  b <= 0 and d <= 0:
    print(max(abs(a), abs(b)) * max(abs(c), abs(d)))
if a  and b and c and d >0:
    print(b*d)
if a<0 and b>0 and c<0 and d>0 :
    print(max(abs(a),abs(b))*max(abs(c),abs(d)))
if b >0 and d<0:
    print(a*d)

Submission status: Wrong Answer

Solution code:
list1 = []
list2 =[]
for num in map(int, input().split()):
  if len(list1) <= 2:
    list1.append(num)
  else:
    list2.append(num)
max1 = max(list1)
max2 = max(list2)
print(max1 * max2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
ans = -float('inf')
for x in range(a, b):
  for y in range(c, d):
    xy = x*y
    ans = max(ans, xy)
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:
  if c < 0: print(a*c)
  else: print(b*c)
elif d < 0:
  if a < 0: print(a*c)
  else: print(a*d)

Submission status: Wrong Answer

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

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

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

print(x * y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

print(max(np.abs([(a*c), (a*d), (b*c), (b*d)])))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
ans = -float('inf')
for i, v in enumerate(a):
  for j in a[i + 1:]:
    ans = max(ans, v * j)
print(ans)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if b == 0:
    b = b - 1

if d == 0:
    d = d - 1

if a == 0:
    a = a + 1

if c == 0:
    c = c + 1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
l=[int(x) for x in input().split()]
a=l[0]
b=l[1]
c=l[2]
d=l[3]

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
ab = [a,b,a,b]
cd = [c,d,d,c]
max_ = -1000000
for x,y in zip(ab,cd):
  max_ = max(max_, x*y)
print(max_)

Submission status: Wrong Answer

Solution code:
#解説配信メモ　ac,ad,bc,bdの最大を出力すればOK
def get_int():
  return list(map(int,input().split()))
a,b,c,d=get_int()
ans=max(a*c,a*d,a*c,b*d)
print(ans)

Submission status: Wrong Answer

Solution code:
# B 
z = list(map(int, input().split(" ")))
maxnum = z[0]*z[2]
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:
a, b, c, d = map(int, input().split())
res1 = a * c
res2 = a * d
res3 = b * c
res4 = b * d
if ((-10**9) <= a, c <= (10**9) and (-10**9) <= b,d <= (10**9)):
    if (res1>res2 and res1>res3 and res1>res4):
        print(res1)
    if (res2>res3 and res2>res4 and res2>res1):
        print(res2)
    if (res3 > res4 and res3 > res2 and res3 > res1):
        print(res1)
    if (res4>res2 and res4>res3 and res4>res1):
        print(res4)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline

# input functions
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))

a, b, c, d = M()
# x +ve and y+ve
if b > 0 and d > 0:
    print(b * d)
elif b < 0 and d < 0:
    print(a * c)
else:
    # ek -ve and ek +ve
    print(max(a*c, a*d, b*c, b*d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
res1 = a * c
res2 = a * d
res3 = b * c
res4 = b * d
if ((-10**9) <= a, c <= b, d <= (-10**9) and (10**9)):
    if (res1>res2 and res1>res3 and res1>res4):
        print(res1)
    if (res2>res3 and res2>res4 and res2>res1):
        print(res2)
    if (res3 > res4 and res3 > res2 and res3 > res1):
        print(res1)
    if (res4>res2 and res4>res3 and res4>res1):
        print(res4)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
v1=0
v2=0
flag=0
if a==0 and b!=0:
  flag=1
  v1=b
elif a!=0 and b==0:
  flag=1
  v1=a
if c==0 and d!=0:
  flag=1
  v2=d
elif c!=0 and d==0:
  flag=1
  v2=c

if c<0 and d<0 and a>0 and b>0:
  flag=1
  v1=a
  v2=d

if a<0 and b<0 and c>0 and d>0:
  flag=1
  v1=b
  v2=c

if c<0 and d>0 and a<0 and b>0:
  flag=1
  v1=max(abs(a),b)
  v2=max(abs(c),d)

if d<0 and c>0 and b<0 and a>0:
  flag=1
  v1=max(abs(b),a)
  v2=max(abs(d),c)

if flag==0:
  if d<0 or c<0 or a<0 or b<0:
    v1=max(a,b)
    v2=max(c,d)
    flag=1



if (a>0 and b>0 and c>0 and d>0) or (a<0 and b<0 and c<0 and d<0):
  flag=1
  v1=b
  v2=d
print(v1*v2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
v1=0
v2=0
flag=0
if a==0 and b!=0:
  flag=1
  v1=b
elif a!=0 and b==0:
  flag=1
  v1=a
if c==0 and d!=0:
  flag=1
  v2=d
elif c!=0 and d==0:
  flag=1
  v2=c

if c<0 and d<0 and a>0 and b>0:
  flag=1
  v1=a
  v2=d

if a<0 and b<0 and c>0 and d>0:
  flag=1
  v1=b
  v2=c

if c<0 and d>0 and a<0 and b>0:
  flag=1
  v1=max(abs(a),b)
  v2=max(abs(c),d)

if d<0 and c>0 and b<0 and a>0:
  flag=1
  v1=max(abs(b),a)
  v2=max(abs(d),c)

if flag==0:
  if d<0 or c<0 or a<0 or b<0:
    v1=max(abs(a),abs(b))
    v2=max(abs(c),abs(d))
    if v1==abs(a) and a<0:
      flag=-1
    elif v1==abs(b) and b<0:
      flag=-1 
    elif v2==abs(c) and c<0:
      flag=-1  
    elif v2==abs(d) and d<0:
      flag=-1 
    else:
      flag=1



if (a>0 and b>0 and c>0 and d>0) or (a<0 and b<0 and c<0 and d<0):
  flag=1
  v1=b
  v2=d
print(v1*v2*flag)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if value[0] < 0 and 0 < value[1] and value[2] < 0 and 0 < value[3]:
    if abs(value[0]) < abs(value[1]) and abs(value[2]) < abs(value[3]):
        print(value[1] * value[3])
    else:
        print(value[0] * value[2])
if value[0] < 0 and value[3] < 0:
    print(value[0] * value[2])
if (0 < value[0] < value[1] and value[2] < value[3] < 0) or (value[0] < 0 < value[1] and 0 < value[2] < value[3]):
    print(value[1] * value[3])

Submission status: Wrong Answer

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

max_x = b
max_y = d
min_x = a
min_y = c

li_1 = [max_x, min_x]
li_2 = [max_y, min_y]
max_num = -10 ** 9
for i in li_1:
    for j in li_2:
        num = i * j
        if num > max_num:
            max_num = num

print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

w = z[0]*z[3]

for x in range(z[0],z[1]):
    for y in range(z[2],z[3]):
        if x*y >= w:
            w = x*y
print(w)

Submission status: Wrong Answer

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

z1 = a*b
z2 = a*c
z3 = b*c
z4 = b*d

l = [z1, z2, z3, z4]
max_value = max(l)
print(max_value)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

elif a <= b <= 0 <= c <= d:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

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

elif c <= d <= 0 <= a <= b:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

else:
    print(a*c)


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

elif a <= b <= 0 and c <= d <= 0:
    print(min(a, b) * min(c, d))

elif a <= 0 <= b and c <= 0 <= d:
    
    print(max(abs(a), abs()))

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

Submission status: Wrong Answer

Solution code:

n = list(map(int, input().split())) 

i = n[0]
j = n[2]
max = 0

for i in range(n[1]):
    for j in range(n[3]):
        if max < i * j:
            max = i*j

print(max)

Submission status: Wrong Answer

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

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

# 両方ともプラスの場合
if a > 0 and b > 0 and c > 0 and d >0:
    print(b * d)

#  片方がマイナスで片方がプラスの場合
if a > 0 and b > 0 and c < 0 and d < 0:
    print(b * c)

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

# 一方がマイナスで一方がプラスの場合
if abs(a) == abs(b):
    x = a
    if abs(d)-abs(c) > 0:
        print(x * d)
    else:
        print(x * c)
elif abs(a) - abs(b) > 0 and abs(c)-abs(d) > 0:
    print(a * c)
elif abs(a) - abs(b) < 0 and abs(c)-abs(d) > 0:
    print(b * d)
if abs(c) == abs(d):
    y = c
    if abs(b)-abs(a) > 0:
        print(y * d)
    else:
        print(y * c)
elif abs(c) - abs(d) > 0:
    print(b * d)
    
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 :
        print(a*c)
    else :
        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 :
        if b * d > 0 :
            print(b*d)
        else :
            print(0)
    else :
        if a * c > 0:
            print(a*c)
        else :
            print(0)
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:
    if a*c >= a*d:
        if a*c >= b*c:
            print(a*c)
if a*d >= b*d:
    if a*d >= b*c:
        if a*d >= a*c:
            print(a*d)
if b*c >= b*d:
    if b*c >= a*d:
        if b*c >= a*c:
            print(b*c)
if b*d >= b*c:
    if b*d >= a*d:
        if b*d >= a*c:
            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 d==0:
    print(b*c)
elif b<0 and c>0:
    print(a*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*d)
elif a>0 and d<0:
    print(a*d)
elif a==0 and d==0:
    print(a*d)
elif a>0 and c>0:
    print(b*d)

Submission status: Wrong Answer

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

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

elif a <= 0 <= b <= c <= d:
    print(b * d)
    
elif a <= b <= 0 <= c <= d:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

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

elif c <= d <= 0 <= a <= b:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

else:
    print(a*c)


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

elif a <= b <= 0 and c <= d <= 0:
    print(min(a, b) * min(c, d))

elif a <= 0 <= b and c <= 0 <= d:
    
    print(max(abs(a), abs()))

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

Submission status: Wrong Answer

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

max_x = b
max_y = d
min_x = a
min_y = c

li = [max_x, max_y, min_x, min_y]

max_num = -10**9
for i in range(len(li)):
    for j in range(i, len(li)):
        num = li[i] * li [j]
        if num > max_num:
            max_num = num

print(max_num)

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

def is_positive(num):
    if num >= 0:
        return 1
    else:
        return 0

is_a_positive = is_positive(a)
is_b_positive = is_positive(b)
is_c_positive = is_positive(c)
is_d_positive = is_positive(d)

if b - a >= 0:
    x = b
else:
    x = a

if d - c >= 0:
    y = d
else:
    y = c

is_x_positive = is_positive(x)
is_y_positive = is_positive(y)

z = x*y

if is_x_positive == 1 and is_y_positive == 1:
    if x == a and y == c:
       n_z = b*d
    elif x == a and y == d:
       n_z = b*c
    elif x == b and y == c:
       n_z = a*d
    elif x == b and y == d:
       n_z = a*c

    if n_z > z:
        z = n_z

elif is_x_positive == 1 and is_y_positive == 0:
    x = a
    z = x * y
elif is_x_positive == 0 and is_y_positive == 1:
    y = c
    z = x * y
elif is_x_positive == 0 and is_y_positive == 0:
    x = a
    y = c
    z = x * y

print(z)

Submission status: Wrong Answer

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

f = lambda x : x < 0
if f(a) and f(b):
  if f(c) and f(d):
    print(a * c)
  elif f(c) and not f(d):
    print(a * c)
  else:
    print(b * d)
elif f(a) and not f(b):
  if f(c) and f(d):
    print(a * c)
  elif f(c) and not f(d):
    print(max(a * c, b * d))
  else:
    print(max(a * c, b * d))
else:
  if f(c) and f(d):
    print(a * d)
  elif f(c) and not f(d):
    print(max(a * c, b * d))
  else:
    print(max(a * c, b * d))

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

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

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

elif a <= b <= 0 <= c <= d:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

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

elif c <= d <= 0 <= a <= b:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)) * -1)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

x = False
y = False

if max(n[0],n[1]) < 0:
    x = True
    
if max(n[2],n[3]) < 0:
    y = True

if n[1] > 0:
    if n[3] > 0:
        ans = n[1] * n[3]
    else:
        if n[0] < 0:
            ans = n[0] * n[2]
        else:
            ans = n[0] * n[3]
elif n[3] > 0:
    if n[2] < 0:
        ans = n[0] * n[2]
    else:
        ans = n[1] * n[2]
else:
    ans = n[0] * n[2]
if n[1] == 0 and n[3] == 0:
    ans = n[0] * n[2]

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
x = [a*b,a*c,b*c,b*d]
ma =x[0]
for i in range(4):
    if ma<=x[i]:
        ma = x[i]
print(ma)

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

Submission status: Wrong Answer

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