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: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    a, b, c, d = LI()
    print(max(a * c, a * d, b * c, b * d))
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

x1 = a * c
x2 = a * d
y1 = b * c
y2 = b * d

print(max(x1,x2,y1,y2))

Submission status: Accepted

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

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

print(mx)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

Solution code:
nums = [int(i) for i in input().split()]
nums1 = nums[:2]
nums2 = nums[2:]
results = []
for i in range(0, 2):
    for j in range (0, 2):
        results.append(nums1[i] * nums2[j])
results.sort()
print(results[-1])

Submission status: Accepted

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

maximum = -float('inf')
for i in range(2):
    for j in range(2,4):
        maximum = max(maximum,A[i]*A[j])

print(maximum)

Submission status: Accepted

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


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

Submission status: Accepted

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

m = max(a[0]*a[2], a[0]*a[3], a[1]*a[2], a[1]*a[3])

print(m)

Submission status: Accepted

Solution code:
a,b,c,d=[int(x) for x in input().split()]
ans=max(a*c,b*d)
if a<0 and b<0:
  cc=a
  a=b
  b=cc

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

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

Submission status: Accepted

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

Submission status: Accepted

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

temp1=a*c
temp2=a*d
temp3=b*c
temp4=b*d

ans=max(temp1,temp2,temp3,temp4)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
a,b,c,d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
abi=int(min(a,b))
abm=int(max(a,b))
cdi=int(min(c,d))
cdm=int(max(c,d))
res1=[]
res2=[]
if abi<0 and abm<0:
  res1=[abi,abm]
elif abi<0 and abm==0:
  res1=[abi,-1,0]
elif abi<0 and abm>0:
  res1=[abi,-1,0,1,abm]
elif abi==0 and abm==0:
  res1=[0]
elif abi==0 and abm>0:
  res1=[0,1,abm]
elif abi>0 and abm>0:
  res1=[abi,abm]

if cdi<0 and cdm<0:
  res2=[cdi,cdm]
elif cdi<0 and cdm==0:
  res2=[cdi,-1,0]
elif cdi<0 and cdm>0:
  res2=[cdi,-1,0,1,cdm]
elif cdi==0 and cdm==0:
  res2=[0]
elif cdi==0 and cdm>0:
  res2=[0,1,cdm]
elif cdi>0 and cdm>0:
  res2=[cdi,cdm]

res=[]
for g in res1:
  for h in res2:
    res.append(g*h)
#print(res)
print(max(res))

Submission status: Accepted

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

num1 = a * c
num2 = a * d
num3 = b * c
num4 = b * d
ans = max(max(num1, num2), max(num3, num4))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

x1 = a * c
x2 = a * d
x3 = b * c
x4 = b * d

l = []
l.append(x1)
l.append(x2)
l.append(x3)
l.append(x4)

ans = max(l)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

res = a * c

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

Submission status: Accepted

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

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

Submission status: Accepted

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

lstx=[a,b]
lsty=[c,d]
result=[]
for i in lstx:
    for n in lsty:
        result.append(i*n)
print(max(result))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calc(intA,intB,intC,intD):  
    W=intA*intC
    X=intB*intC
    Y=intA*intD
    Z=intB*intD
    ret=max(W,X,Y,Z)
    return ret

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

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

Submission status: Accepted

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

Submission status: Accepted

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

fmax = abcd[0]
for i in abcd:
    if i > fmax:
        fmax = i
print(fmax)

Submission status: Accepted

Solution code:
# cording:utf-8

# a,b,c,dを入力
a,b,c,d = map(int, input().split())

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

Submission status: Accepted

Solution code:
li = input().split()
# li  = [3,5,-4,-2]
li1 = li[0:2]
li2 = li[2:4]

ans = -999999999999999999999999999999999

for x in li1:
    for y in li2:
        tmp = int(x)*int(y)
        if tmp > ans:
            ans = tmp
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    a, b, c, d = map(int, input().split())
    w = a*c
    x = a*d
    y = b*c
    z = b*d
    ans = max(w, x, y, z)
    print(ans)

resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = list(map(int, input().strip().split()))
ab = [a,b]
cd = [c,d]
xy = a*c

abcd = [a,b,c,d]

for i in range(2):
    for j in range(2):
        if ab[i]*cd[j] > xy:
            xy = ab[i]*cd[j]

print(xy)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

F.sort(reverse =True)

print(F[0])

Submission status: Accepted

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

Submission status: Accepted

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

print(max(x))

Submission status: Accepted

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

ans = 0

if a>=0:
    if d>=0:
        ans = b*d
    else:
        ans = a*d

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

else:
    if c>=0:
        ans = b*c
    else:
        ans = a*c

print(ans)

Submission status: Accepted

Solution code:
def func(a,b,c,d):
  result = a * c
  if a * d > result:
    result = a * d
  if b * c > result:
    result = b * c
  if b * d > result:
    result = b * d
  return result

if __name__ == "__main__":
  inputStr = input().split()
  a = int(inputStr[0])
  b = int(inputStr[1])
  c = int(inputStr[2])
  d = int(inputStr[3])
  print(func(a,b,c,d))

Submission status: Accepted

Solution code:
A, B, C, D = map(int, input().split())
print(max([A * C, A * D, B * C, B * D]))

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
w = 0
z = 0
x = 0
y = 0

w = a[0] * a[2]
z = a[0] * a[3]
x = a[1] * a[2]
y = a[1] * a[3]
print(max(w,z,x,y))

Submission status: Accepted

Solution code:
a = [int(s) for s in input().split()]
b = a[0]
c = a[1]
d = a[2]
e = a[3]
f = int(0)
g = int(0)

if b >= 0 and d >= 0:
    print(c*e)
elif b < 0 and c >= 0 and d < 0 and e >= 0:
    f = b * d
    g = c * e
    print(max([f,g]))
elif b >= 0 and d < 0 and e >= 0:
    print(c*e)
elif d >= 0 and b < 0 and c >= 0:
    print(c*e)
elif b >= 0 and e < 0:
    print(b*e)
elif d >= 0 and c < 0:
    print(c*d)
else:
    print(b*d)

Submission status: Accepted

Solution code:
a, b, c, d =(int(x) for x in input().split())
a1 = a * c
a2 = a * d
a3 = b * c
a4 = b * d
print(max(a1, a2, a3, a4))

Submission status: Accepted

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: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)


def main(input, print):
    a, b, c, d = map(int, input().split())
    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: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

xl = [a,b]
yl = [c,d]
for x in xl:
  for y in yl:
    xy = x*y
    if(x == a and y == c):
      xy_m = xy
	
    xy_m = max(xy_m,xy)

print(xy_m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L = list(map(int, input().split()))
A = [L[0] * L[2], L[0] * L[3], L[1] * L[2], L[1] * L[3]]
print(max(A))

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
p1=0;p2=0;p3=0;p4=0
p1=a*c
p2=a*d
p3=b*c
p4=b*d
print(max(max(p1,p2),max(p3,p4)))

Submission status: Accepted

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 * y_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: Accepted

Solution code:
list = input().split(" ")
a, b, c, d = int(list[0]), int(list[1]), int(list[2]), int(list[3])
ans1 = a * c
ans2 = a * d
ans3 = b * c
ans4 = b * d
ans_list = [ans1, ans2, ans3, ans4]
ans_list.sort()
print(ans_list[3])

Submission status: Accepted

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


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

Submission status: Accepted

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)

print(max(l))

Submission status: Accepted

Solution code:
import itertools
ls = list(map(int, input().split()))
ab = ls[:2]
cd = ls[2:]
p = itertools.product(ab, cd)
ans = []
for i in p:
    ans.append(i[0] * i[1])
print(max(ans))

Submission status: Accepted

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

m = l[0]*l[2]

for i in range(0,2):
  for j in range(2,4):
    if l[i]*l[j] > m:
      m = l[i]*l[j]
      
print(m)

Submission status: Accepted

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

m=a*c

if a*d>m:
  m=a*d

if b*c>m:
  m=b*c

if b*d>m:
  m=b*d
  
print(m)

Submission status: Accepted

Solution code:
num = input().split()
lis = []
for i in range(2):
  for j in range(2,4):
    lis.append(int(num[i])*int(num[j]))

lis.sort(reverse=True)
print(lis[0])

Submission status: Accepted

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

ans = -float('inf')

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':

	a,b,c,d = map(int,input().split())
	
	ans = -10**19;
	A = [a,b]
	B = [c,d]
	for i in A:
		for j in B:
			tmp = i * j
			ans = max(ans,tmp)
	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
array = input().split()
ab = array[0:2]
cd = array[2:4]
res = []

for x in ab:
    for y in cd:
      res.append(int(x)*int(y))

print(max(res))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ac = a * c
ad = a * d
bc = b * c
bd = b * d

print(max(ac,ad,bc,bd))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

E = b*c
F = b*d
print(max([A,B,C,D,E,F]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf8
# 日本語を入力できるようにするために上記一文が必要

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

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

ans = num_list[0]
for i in num_list:
        if ans < i:
                ans = i

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(max(a[0]*a[-1],a[0]*a[-2],a[1]*a[-1],a[1]*a[-2]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


def solve(a: int, b: int, c: int, d: int):
    ac = a*c
    ad = a*d
    bc = b*c
    bd = b*d
    solve = [ac, ad, bc, bd]
    solve = sorted(solve)
    return print(solve[-1])




# 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: Accepted

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

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

Submission status: Accepted

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

a = [x[0]* x[2],x[0]* x[3],x[1]* x[2],x[1]* x[3]]
             
print(max(a))

Submission status: Accepted

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

Submission status: Accepted

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

ac = a*c
ad= a*d
bc = b*c
bd = b*d
x = [ ]
x.append(ac)
x.append(ad)
x.append(bc)
x.append(bd)

x.sort(reverse=True)

print(x[0])

Submission status: Accepted

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

x1 = a * c
x2 = a * d
x3 = b * c
x4 = b * d

win = x1
if win < x2:
  win = x2
if win < x3:
  win = x3
if win < x4:
  win = x4

print(win)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def run(a, b, c, d):
    '''

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

if __name__ == '__main__':
    a, b, c, d = list(map(int, input().split()))

    run(a, b, c, d)

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

l = [ac, ad, bc, bd]
ans = max(l)
print(ans)

Submission status: Accepted

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

ac = a * c
ad = a * d
bc = b * c
bd = b * d

ans = max(ac, ad, bc, bd)

print(ans)

Submission status: Accepted

Solution code:
p = input().split()
ans = []
ans.append(int(p[0]) * int(p[2]))
ans.append(int(p[0]) * int(p[3]))
ans.append(int(p[1]) * int(p[2]))
ans.append(int(p[1]) * int(p[3]))
ans = sorted(ans)
print(ans[-1])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nums = input().split(" ")
nums = list(map(int, nums))
sign = []

ir = False
if nums[0]==0 and nums[1]==0:
  ir = True
if nums[2]==0 and nums[3]==0:
  ir = True

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])
if ir:
  print(0)
else:
	print(max(anss))

Submission status: Accepted

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

bd = b * d
ac = a * c
bc = b * c
ad = a * d
ans = max(bd, ac, bc, ad)

print(ans)

Submission status: Accepted

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

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

print(max(ls))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
print(max(
  a[0] * a[2], a[0] * a[3], a[1] * a[2], a[1] * a[3]
))

Submission status: Accepted

Solution code:
a, b , c, d = map(int, input().split())
r1, r2, r3, r4 = a*c, a*d, b*c, b*d
li = [r1, r2, r3, r4]
print(max(li))

Submission status: Accepted

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

toki = a*c
shigi = a*d
nue = b*c
iri = b*d

print(max(toki,shigi,nue,iri))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
l = [a*c, a*d, b*c, b*d]
temp = l[0]
for i in range(3):
    if temp < l[i + 1]:
        temp = l[i + 1]

print(temp)

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
A = [a, b]
C = [c, d]
result = -1000000000000000000
for i in A:
    for j in C:
        hoge = i*j
        if result < hoge:
            result = hoge
            
print(result)

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
list1, list2 = [a, b], [c, d]
max1, max2, min1, min2 = max(list1), max(list2), min(list1), min(list2)
print(max(max1 * max2, min1 * min2, max1 * min2, max2 * min1))

Submission status: Accepted

Solution code:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

a,b,c,d = miinps()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(250000)

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

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

    #
    # pairs=[]
    # for i in range(n):
    #     pairs.append(list(map(int, input().split())))
    #
    # dp =  [[0] * 10001 for i in range(101)]
    # for j in range(0, 10001):
    #     for i in range(0,n):
    #         if j >= pairs[i][1]:
    #             dp[i+1][j] = max(dp[i][j-pairs[i][1]] + pairs[i][0], dp[i][j])
    #         else:
    #             dp[i+1][j] = dp[i][j]
    #
    # print(dp[n][w])
main()

Submission status: Accepted

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