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:
# 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:
def probB():
    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)
    else:
        # どちらかが負
        print(max(a * d, b * c))


def main():
    probB()


if __name__ == '__main__':
    main()

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 or d==0):
    if(a<0 and c>0):
        print(0)
        exit()
    elif(c>0 and d<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 = map(int, input().split())
ans = 0

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

Submission status: Wrong Answer

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

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

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 (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)
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x, y = 0, 0

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

if a < 0 and b < 0:
    y = c
else:
    y = d

if c < 0 and d < 0:
    x = a
else:
    x = b


print(x*y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -10e9

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = [int(s) for s in input().split()]
if b <= 0:
    if d <= 0:
        ans = a * c
    else:
        ans = b * c
else:
    if d <= 0:
        ans = a * d
    else:
        ans = b * d
        
print(ans)

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

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

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

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

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 x and y:
    ans = min(n[0],n[1]) * min(n[2],n[3])
elif y:
    ans = min(n[0],n[1]) * max(n[2],n[3])
elif x:
    ans = max(n[0],n[1]) * min(n[2],n[3])
else:
    ans = max(n[0],n[1]) * max(n[2],n[3])

print(ans)

Submission status: Wrong Answer

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

ab = min(a, b)
cd = min(c, d)

if 0 < ab and 0 < cd:
    print(max(a, b) * max(c, d))
elif ab < 0 and cd < 0:
    print(min(a, b) * min(c, d))
elif 0 < ab and cd < 0:
    print(min(a, b) * max(c, d))
elif ab < 0 and 0 < cd:
    print(max(a, b) * min(c, d))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

e = max(a,b)
f = min(a,b)
g = max(c,d)
h = min(c,d)

if e <= 0 and g <= 0:
    print(f*h)
elif e <= 0 and h > 0:
    print(h*e)
elif f > 0 and g <= 0:
    print(f*g)
else:
    print(e*f)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(1000000)
from collections import deque

# スペース区切りの整数の入力
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 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:
    print(a*c)
elif b<=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())
A = max(a,b)
B = max(c,d)
if A <= 0 and B > 0:
  A = max(a,b)
  B = min(c,d)
elif A >= 0 and B < 0:
  A = min(a,b)
  B = max(c,d)
  
elif A <= 0 and B <= 0:
  A = min(a,b)
  B = min(c,d)

print(A*B)

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)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

#print(a,b,c,d)

if (b < 0 and d < 0) or (b > 0 and d > 0) or    (b == 0 and d > 0) or  (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())

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(max(X[0]*X[1], X[1]*X[2], X[2]*X[3], X[3]*X[0], X[0]*X[2],
         X[1]*X[3]))

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

max([a * c, a * d, b * c, b * d])

Submission status: Wrong Answer

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

print(b*d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a<=b:
  s=b
else:
  s=a
  
if c<=d:
  t=d
else:
  t=c
  
print(s*t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

maximum = -1*10**9
ifzero = 0
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())
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)
else:
  print(b*d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -100000000000
tmp = 0
tmp = a*c
if ans < tmp:
    ans = tmp
tmp = a*d
if ans < tmp:
    ans = tmp
tmp = b*d
if ans < tmp:
    ans = tmp

tmp = b*c
if ans < tmp:
    ans = tmp
print(ans)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
ac = a*c
ad = a*d
bc = b*d
bd = b*d

ans = ac
if ans < ad:
  ans = ad
if ans < bc:
  ans = bc
if ans < bd:
  ans = bd
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
m = n.split(" ")

x_min = int(m[0])
x_max = int(m[1])
y_min = int(m[2])
y_max = int(m[3])

a = x_min * y_min
b = x_min * y_max
c = x_max * y_min
d = x_max * y_max

if a > b and a > c and a > d:
  print(a)

elif b > a and b > c and b > d:
  print(b)

elif c > a and c > b and c > d:
  print(c)

elif d > a and d > b and d > c:
  print(d)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
ac = a*c
ad = a*d
bc = b*c
bd = b*d

if ac>ad and ac>bc and ac>bd:
  print(ac)
elif ad >bc and ad>bd and ad>ac:
  print(ad)
elif bc>ac and bc>ad and bc>bd:
  print(bd)
elif bd>ac and bd>ad and bd>bc:
  print(bd)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def solve():
    a,b,c,d=map(int,input().split())
    if b>0 and d>0:
        print(b*d)
        return
    print(max(a*c,a*d,b*c,b*d))
    

if __name__=="__main__":
    solve()

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

A = a*c
B = a*d
C = b*c
D = b*d


max([A, B, C, D])

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

Submission status: Wrong Answer

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

ans = -10**9
for i in range(2):
    for j in range(2, 4):
        if x[i] * x[j] > ans:
            ans = x[i] * x[j]

print(ans)

Submission status: Wrong Answer

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

if b <= 0 and d <= 0:
  print(a * b)
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:
import sys
sys.setrecursionlimit(10**6)


def main(input, print):
    a, b, c, d = map(int, input().split())
    ans = -10**10
    ans = max(ans, a*c)
    ans = max(ans, a*d)
    ans = max(ans, b*c)
    ans = max(ans, b*d)
    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

max_xy = 0

for i in list_xy:
  if i >= max_xy:
    max_xy = i

print(max_xy)

Submission status: Wrong Answer

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

if b <= 0:
  cnt+=1
if d <= 0:
  cnt+=1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

a =n[0]*n[2]
b =n[0]*n[3]
c =n[1]*n[2]
d =n[0]*n[3]

x = max(a,b,c,d)

print(x)

Submission status: Wrong Answer

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

if a * b < 0:
    x.append(-1)
    x.append(1)
    
if c * d < 0:
    y.append(-1)
    y.append(1)
    
ans = - (10 ** 10)
    
for i in x:
    for j in y:
        ans = max((i*j),ans)
        
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

maxAB = 0
maxCD = 0
if A < 0 and B < 0 and C < 0 and D < 0:
    maxAB = max(A,B)
    maxCD = max(C,D)
elif C < 0 and D < 0:
    maxAB = min(A,B)
    maxCD = max(C,D)
elif A < 0 and B < 0:
    maxAB = max(A,B)
    maxCD = min(C,D)
else:
    maxAB = max(A,B)
    maxCD = max(C,D)

print(maxAB * maxCD)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -1000000
tmp = 0
tmp = a*c
if ans < tmp:
    ans = tmp
tmp = a*d
if ans < tmp:
    ans = tmp
tmp = b*d
if ans < tmp:
    ans = tmp

tmp = b*c
if ans < tmp:
    ans = tmp
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())
t = list()
ac = a*c
bc = b*c
ad = a*d
bd = b*d
t.append(ac)
t.append(bc)
t.append(ad)
t.append(bd)
ans = -1 * 10**9
for i in range(4):
  ans = max(t[i],ans)
print(ans)

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

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
ans=-10**9
for x in [a,b]:
    for y in [c,d]:
        ans=max(ans,x*y)
print(ans)