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:
templist = input().split()
a = int(templist[0])
b = int(templist[1])
c = int(templist[2])
d = int(templist[3])
flg1 = 0
flg2 = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

max=a*b
for i in  (a,b):
    for j in (c,d):
        if max < i*j:
            max = i*j

print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

ac = a*c
bd = b*d

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

Submission status: Wrong Answer

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

# Avoid using 0
if a == 0:
    a += 1
if b == 0:
    b -= 1
if c == 0:
    c += 1
if d == 0:
    d -= 1

if (b > 0 and d > 0) or (b < 0 and d < 0):
    # Return the max positive value
    print(max(abs(a), abs(b)) * max(abs(c), abs(d)))
else:
    # Return the max negative value
    print(-(min(abs(a), abs(b)) * min(abs(c), abs(d))))

Submission status: Wrong Answer

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

a += 1
c += 1

maxn = a*c

x = a*d
y = b*c
z = b*d

if maxn < x :
    maxn = x
if maxn < y :
    maxn = y
if maxn < z :
    maxn = z

print(maxn)

Submission status: Wrong Answer

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

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

if 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())
A=abs(a)
B=abs(b)
C=abs(c)
D=abs(d)
l=(A,B,C,D)
ls=sorted(l)
print(ls[3]*ls[2])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

ans = ab * cd

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

print(str(ans))

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 = min(n[0],n[1]) * min(n[2],n[3])
    else:
        ans = n[0] * n[2]
elif n[3] == 0:
    ans = n[0] * n[2]
elif 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 = sorted(list(map(int, input().split())))
print(max(
  a[0] * a[1], a[-2] * a[-1]
))

Submission status: Wrong Answer

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

if a<=0 and b<=0:
  xf=-1
else:
  xf=1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
t = input()
t = t.split(" ")
t = [int(x) for x in t]

a,b = t[0], t[1]
c,d = t[2], t[3]

g1_max = max(a,b)
g1_min = min(a,b)

g2_max = max(c,d)
g2_min = min(c,d)

if b >  0  and d > 0:
  print(g1_max*g2_max)
elif b <= 0 and d > 0:
  print(g1_max*g2_min)
elif b <= 0 and d <= 0:
  print(g1_min*g2_min)
else:
  print(g1_min*g2_max)

Submission status: Wrong Answer

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

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=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:
"""
A=abs(a)
B=abs(b)
C=abs(c)
D=abs(d)

check_1 = a*c
check_2=a*d
check_3=b*c
check_4=b*d

if check_1<=check_2:
    check_1=check_2

if check_3<=check_4:
    check_3=check_4

if check_1<=check_3:
    print(check_1)
else:
    print(check_2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    a, b, c, d= mulinputs()

    t = -1*(10**9)+1
    for x in (a,b):
        for y in (c, d):
            t = max(t, x*y)
    print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]

mat = np.array([])
for i in [a,b]:
    for j in [c,d]:
        mat = np.append(mat, i*j)
print(int(np.max(mat)))

Submission status: Wrong Answer

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

    ans = float('inf') * -1
    for i in [a, b]:
        for j in [c, d]:
            ans = max(ans, i * j)

    if (a < 0 and 0 < b):
        ans = min(ans, 0)
    if (c < 0 and 0 < d):
        ans = min(ans, 0)
    print(ans)


if __name__ == "__main__":
    main()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
nums = input().split(" ")
nums = list(map(int, nums))
sign = []
    
if nums[0] == 0:
  nums[0] = 1
if nums[1] == 0:
  nums[1] = -1
if nums[2] == 0:
  nums[2] = 1
if nums[3] == 0:
  nums[3] = -1

anss = []
for i in range(2):
  for j in range(2):
    anss.append(nums[i]*nums[j+2])
print(max(anss))

Submission status: Wrong Answer

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

ans1 = a*c
ans2 = b*d
ans3 = a*d
ans4 = b*c

    
if d<0 & a>0:
    print(ans3)
elif c>0 & b<0:
    print(ans4)    
else:
    if ans1 > ans2:
        print(ans1)
    else:
        print(ans2)

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

Submission status: Wrong Answer

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

ans = -(10**10)

for x in [a, b]:
    for y in [c, d]:
        ans = max(ans, x*y)
print(ans)

Submission status: Wrong Answer

Solution code:
t = input()
t = t.split(" ")
t = [int(x) for x in t]

a,b = t[0], t[1]
c,d = t[2], t[3]

g1_max = max(a,b)
g1_min = min(a,b)

g2_max = max(c,d)
g2_min = min(c,d)

if b >  0  and d > 0:
  print(g1_max*g2_max)
elif b < 0 and d >0:
  print(g1_max*g2_min)
elif b <= 0 and d <= 0:
  print(g1_min*g2_min)
else:
  print(g1_min*g2_max)

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(a: int, b: int, c: int, d: int):
    if b < 0:
        return print(a*c)
    if a > 0:
        return print(b*d)
    
    if b > 0 > a:
        if c < 0 < d:
            return print(max(a*c, b*d))
        elif d < 0:
            return print(a*c)
        elif c > 0:
            return print(b*d)





# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    solve(a, b, c, d)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
  li = list(map(int, input().split()))
  array = []
  array.append(li[0] * li[1])
  array.append(li[0] * li[2])
  array.append(li[0] * li[3])
  array.append(li[1] * li[2])
  array.append(li[1] * li[3])
  array.append(li[2] * li[3])
  
  print(max(array))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if abs(a) > abs(b):
  a,b = b,a

if abs(c) > abs(d):
  c,d = d,c

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# ans = 0
ans_max = -10**9

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def calc(intA,intB,intC,intD):
    #b>0　d>0　→x × y>0 
    if b>0 and d>0:
       ret = b*d
    elif b<=0 and d<=0:
       ret = a*c
    elif b<=0 and d>0:
       ret = b*c
    elif b>0 and d<=0:
       ret = a*d
    return ret

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

print(calc(a,b,c,d))

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
 
x_max = max(a, b)
x_min = min(a, b)
 
y_max = max(c, d)
y_min = min(c, d)
 
ans = max(x_max * y_max, x_max * x_min, x_min * y_max, x_min * y_min)

if (x_max >= 0 and x_min <= 0) or (y_max >= 0 and y_min <= 0):
  ans = max(ans, 0)

print(ans)

Submission status: Wrong Answer

Solution code:
num=input().split()
num=[int(a) for a in num]
numab=[abs(a) for a in num]
x=min(numab[0],numab[1])
y=min(numab[2],numab[3])

#+,+
if num[1]>=0 and num[3]>=0:
  print(num[1]*num[3])
#-,-
elif num[0]<0 and num[3]<0:
  print(num[0]*num[2])
#+,- or-,+
else:
  print(-1*x*y)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = []
ans.append(a*b)
ans.append(a*d)
ans.append(b*c)
ans.append(b*d)

print(max(ans))

Submission status: Wrong Answer

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

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

print(max(num_lines))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int,input().split())
x = 0
y = 0
if a >= 0 and c >= 0:
  print(b * d)
elif a >= 0 and d < 0:
  print(a * d)
elif b < 0 and c >= 0:
  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())
ans = -10**9
ab = [a,b]
cd = [c,d]
for i in ab:
  for j in cd:
    ans = max(i*j,ans)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif b<0 and c>0:
    print(b*c)
elif a>0 and d<0:
    print(a*d)
else:
    print(a*c)

Submission status: Wrong Answer

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

def seki(x,y):
  return x*y
result=[seki(i[0],i[2]),seki(i[0],i[3]),seki(i[1],i[2]),seki(i[1],i[3])]

for i in result:
  if max_num< i:
    max_num=i

print(max_num)

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

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:
        if a >= 0:
            print(a*d)
        else:
            print(a*c)
    elif b <= 0 and d >= 0:
        if c >= 0:
            print(b*c)
        else:
            print(a*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 and c>0: print(b*d)
else:
  if b>0 and d>0:
    print(b*d)
  elif 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:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 21:03:42 2020

@author: naoki
"""

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

if ac>=bd:
    print(ac)
else:
    print(bd)