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:
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(max(b*d,a*c))
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
rangeNum = input().split()
ansNum = []

# a*c, a*d
ansNum.append(int(rangeNum[0])*int(rangeNum[2]))
ansNum.append(int(rangeNum[0])*int(rangeNum[3]))

# b*c b*d
ansNum.append(int(rangeNum[1])*int(rangeNum[2]))
ansNum.append(int(rangeNum[1])*int(rangeNum[3]))

print(max(ansNum))

Submission status: Accepted

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

#x = [i for i in range(a,b+1)]
#y = [j for j in range(c,d+1)]

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

answer_list = [x_max*y_max, x_max*y_min, x_min*y_max, x_min*y_min]

print(max(answer_list))

Submission status: Accepted

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

ac = a * c
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(i) for i in input().split()]
ans0 = [a*c, a*d, b*c, b*d]
ans = ans0[0]
for i in range(1, 4):
    if ans0[i] > ans:
        ans = ans0[i]
print(ans)

Submission status: Accepted

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

maximam=-1000000000000000000000000000000000


for i in range(0,2):
    for j in range(2,4):
        kari=a[i]*a[j]
        maximam=max(maximam,kari)
    

print(maximam)

Submission status: Accepted

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

Submission status: Accepted

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

if a >= 0 and c >= 0:
    print(b*d)
else :
    ac = a*c
    ad = a*d
    bc = b*c
    bd = b*d
    nums = [ac,ad,bc,bd]
    print(max(nums))

Submission status: Accepted

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

ans = a*c
if ans < a*d:
    ans = a*d
if ans < b*c:
    ans = b*c
if ans < b*d:
    ans = b*d

print(ans)

Submission status: Accepted

Solution code:
a=input()
a=[int(i) for i in a.split()]
a1=[a[0],a[1]]
a2=[a[2],a[3]]

re=[]

for i in a1:
	for j in a2:
		m=i*j
		re.append(m)

print(max(re))

Submission status: Accepted

Solution code:
import sys
a,b,c,d=map(int,input().split())
l=[0 for i in range(4)]
l[0]=max(a,b)*max(c,d)
l[1]=max(a,b)*min(c,d)
l[2]=min(a,b)*max(c,d)
l[3]=min(a,b)*min(c,d)
print(max(l))

Submission status: Accepted

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

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

print(max(e))

Submission status: Accepted

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

n1 = a * c
n2 = b*d
n3 = c*b
n4 = d*a
print(max(n1,n2,n3,n4))

Submission status: Accepted

Solution code:
abcd = list(map(int,input().split()))
ma = -float('inf')
for i in range(2):
    for ii in range(2,4):
        ma = max(abcd[i]*abcd[ii],ma)

print(ma)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a,b,c,d = inpm()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

p = [a,b]
if a <= 0 <= b:
    p.append(0)
q = [c,d]
if c <= 0 <= d:
    q.append(0)

res = a*c
for x in p:
    for y in q:
        res = max(res,x*y)

print(res)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
lis = list(map(int,input().split()))
lists = []
inc = 0
# スペース区切りの整数の入力
for i in range(2):
    for j in range(2):
        lists.append(lis[i]*lis[j+2])
        inc += 1

    
# 出力
print("{}".format(max(lists)))

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    answer = a*c
    if answer < a*d:
        answer = a*d
    if answer < b*c:
        answer = b*c
    if answer < b*d:
        answer = b*d
    return answer


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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def fn(a, b, c, d):
  result = []
  result.append(a * c)
  result.append(a * d)
  result.append(b * c)
  result.append(b * d)
  if (a <= 0 and b >= 0) or (c <= 0 and d >= 0):
    result.append(0)

  return max(result)

if __name__ == "__main__":
  input = list(map(int, input().split()))
  print(fn(input[0], input[1], input[2], input[3]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if(a*b < 0 or c*d < 0):
    list.append(0)

print(max(list))

Submission status: Accepted

Solution code:
a,b,c,d=input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
list1=[]
list1.append(a*c)
list1.append(a*d)
list1.append(b*c)
list1.append(b*d)
list1.sort()
print(list1[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())

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

max = ac
if(max<ad):
    max=ad
if(max<bc):
    max=bc
if(max<bd):
    max=bd

print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C, D = (int(x) for x in input().split())
L = []
L.append(A * C)
L.append(A * D)
L.append(B * C)
L.append(B * D)
L.sort()
print(L[3])

Submission status: Accepted

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

seki = []
seki.append(a*c)
seki.append(a*d)
seki.append(b*c)
seki.append(b*d)
seki = sorted(seki)
print(seki[-1])

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
res1 = a*c
res2 = a*d
res3 = b*c
res4 = b*d

x =[]
y =[]
z =[]
l =[]

x.append(res1)
y.append(res2)
z.append(res3)
l.append(res4)

res0 = x+y+z+l

m = max(res0)

print(m)

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
ans = -10**19
ab = [a,b]
cd = [c,d]
for i in ab:
  for j in cd:
    ans = max(i*j,ans)
print(ans)

Submission status: Accepted

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

for i in range(2):
  for j in range(2,4):
    if i == 0 and j == 2:
      ans = arr[i]*arr[j]
    else:
      ans = max(ans, arr[i]*arr[j])
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans_list = []

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

print(max(ans_list))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
e = [a, b]; f = [c, d]; g = -10**18
if a < 0 and 0 < b: e.append(0)
if c < 0 and 0 < d: f.append(0)
for i in range(len(e)):
    for j in range(len(f)):
        g = max(g, e[i]*f[j])
print(g)

Submission status: Accepted

Solution code:

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

pp = b*d
pm = b*c
mp = a*d
mm = a*c

ans = pp

if (ans < pm):
    ans = pm
if (ans < mp):
    ans = mp
if (ans < mm):
    ans = mm

print(ans)

Submission status: Accepted

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

e = a*c
f = b*d
g = a*d
h = b*c
ans = e

if(ans<f):
    ans = f
if(ans<g):
    ans = g
if(ans<h):
    ans = h

print(ans)

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
ans=0
kouho1=a*c
kouho2=a*d
kouho3=b*c
kouho4=b*d
ans=max(kouho1,kouho2,kouho3,kouho4)
if a*b<=0 or c*d<=0:
    ans=max(ans,0)
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:
a, b, c, d = map(int, input().split())

minx = min(a, b)
miny = min(c, d)
maxx = max(a, b)
maxy = max(c, d)

print(max(miny * minx, maxx * maxy, maxx * miny, minx * maxy))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    a, b, c, d = mi()
    lx = [a, b]
    ly = [c, d]
    if a <= 0 <= b:
        lx.append(0)
    if c <= 0 <= d:
        ly.append(0)
    
    m = - inf
    for x in lx:
        for y in ly:
            m = max(m, x * y)
    print(m)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

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

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

max_value = -float('inf')
if max_value < a * c:
    max_value = a * c
if max_value < a * d:
    max_value = a * d
if max_value < b * c:
    max_value = b * c
if max_value < b * d:
    max_value = b * d

print(max_value)

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 = ac
if ans < ad:
    ans = ad
if ans < bc:
    ans = bc
if ans < bd:
    ans = bd
    
print(ans)

Submission status: Accepted

Solution code:
details = input()
details = details.split()
first = details[:2]
second = details[2:]
checker = []
for numbers in first:
    for dig in second:
        checker.append(int(numbers) * int(dig))
print(max(checker))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# input here
_INPUT = """\

"""
"""
K = int(input())
H, W, K = map(int, input().split())
a = list(map(int, input().split()))
xy = [list(map(int, input().split())) for i in range(N)]
p = tuple(map(int,input().split()))
"""
def main():
    a, b, c, d = map(int, input().split())

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

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


            
if __name__ == '__main__':
    import io
    import sys
    import math
    import itertools
    from collections import deque

    # sys.stdin = io.StringIO(_INPUT)
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
x = [a,b]
y = [c,d]
max = -(10**18)
for i in x:
    for j in y:
        if i*j > max:
            max = i*j
print(max)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
in_n = input().split()
a,b,c,d = int(in_n[0]),int(in_n[1]),int(in_n[2]),int(in_n[3])
num_list = []
num_list.append(a * c)
num_list.append(a * d)
num_list.append(b * c)
num_list.append(b * d)
if a <= 0 and b >= 0:
    num_list.append(0)
if c <= 0 and d >= 0:
    num_list.append(0)
print(max(num_list))

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3

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

nums = []

for x in (a, b):
    for y in (c, d):
        nums.append(x * y)

print(max(nums))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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)
else:
    print(max(b*c,max(a*d,max(a*c,b*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,b,c,d=list(map(int,input().split(" ")))
list=[a*c,a*d,b*c,b*d]
B=sorted(list)
print(B[-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
listA=list(map(int,input().split()))
x_list = []
for i in [0,1]:
    x_list.append(listA[i])

y_list = []
for i in [2,3]:
    y_list.append(listA[i])

i_list = []
for x in x_list:
    for y in y_list:
        i_list.append(x*y)

print(max(i_list))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l1 = [a, b]
l2 = [c, d]

p = itertools.product(l1, l2)

max_num = -inf

for e1, e2 in p:
    max_num = max(max_num, e1*e2)
print(max_num)

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

print(max(x, y, z, o))

Submission status: Accepted

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

if b*c>big:
    big=b*c
if b*d>big:
    big=b*d

print(big)

Submission status: Accepted

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

l1=a*c
l2=a*d
l3=b*c
l4=b*d
ans = max(l1,l2,l3,l4)
print(ans)

Submission status: Accepted

Solution code:
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 ** 2


a, b, c, d = LI()

x = [a, b]
y = [c, d]
xy = -mod

for i in range(2):
    for j in range(2):
        buf = x[i] * y[j]
        # print(buf)
        if xy < buf:
            xy = buf
print(xy)

Submission status: Accepted

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


sums = []

x1 = sums.append(a*c)
x2 = sums.append(a*d)
x3 = sums.append(b*c)
x4 = sums.append(b*d)

print(max(sums))

Submission status: Accepted

Solution code:
a,b,c,d = [int(s) for s 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())
ans=-100000000000000000000000000000

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

Submission status: Accepted

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

cal1 = A*C
cal2 = A*D
cal3 = B*C
cal4 = B*D

ans = max(cal1,cal2,cal3,cal4)
print(ans)

Submission status: Accepted

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

ans = a[0] * a[2]
if a[0] * a[3] > ans:
    ans = a[0] * a[3]
if a[1] * a[2] > ans:
    ans = a[1] * a[2]
if a[1] * a[3] > ans:
    ans = a[1] * a[3]

print(ans)

Submission status: Accepted

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

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

mn = min(a, b)
mn1 = min(c, d)

ans = max(mx * mx1, mn * mn1, mx * mn1, mx1 * mn)

print(ans)

Submission status: Accepted

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

if M <= b * d:
    M = b * d

print(M)

Submission status: Accepted

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

x1 = data[0]
x2 = data[1]
y1 = data[2]
y2 = data[3]

if x1 >= 0 and y2 < 0:
    print(x1 * y2)
elif x2 < 0 and y1 >= 0:
    print(x2 * y1)
elif (x1 < 0 and x2 >= 0) and (y1 < 0 and y2 >= 0):
    print(max(x1*y1,x2*y2))
elif x1 >= 0 or y1 >= 0:
    print(x2 * y2)
elif x2 < 0 or y2 < 0:
    print(x1 * y1)

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import itertools
a,b,c,d = map(int,input().split())
x = [a,b]
y = [c,d]
comb = list(itertools.product(x,y))
ans = x[0]*y[0]

for i in range(len(comb)):
    seki = comb[i][0] * comb[i][1]
    if seki > ans:
        ans = seki
print(ans)

Submission status: Accepted

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

#print(a,b,c,d)

X = [a,b]
Y = [c,d]

ans = a*c

for i in X:
    for j in Y:
        if ans < i*j:
            ans = i*j

print(ans)

Submission status: Accepted

Solution code:
a, b, c, d = map(int, open(0).read().split())
 
if a * c <= 0 and b * d <= 0:
  print(max([a * d, b * c]))
else:
  print(max([a * c, b * d]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

maxval = a * c
if a * d > maxval:
  maxval = a * d
if b * c > maxval:
  maxval = b * c
if b * d > maxval:
  maxval = b * d

print(maxval)

Submission status: Accepted

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

Submission status: Accepted

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

list = []
list.append(a[0]*a[2])
list.append(a[0]*a[3])
list.append(a[1]*a[2])
list.append(a[1]*a[3])

print(max(list))

Submission status: Accepted

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

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

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

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

s = n[0]*n[2]
t = [0,1,1]
u = [3,2,3]
for i in range(3):
    s1 = n[t[i]]*n[u[i]]
    s = max(s,s1)
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    ans_a = a * c
    ans_b = a * d
    ans_c = b * c
    ans_d = b * d
    if ans_a <= ans_b:
        if ans_c <= ans_b:
            if ans_d <= ans_b:
                print(ans_b)
                return 0
            elif ans_b <= ans_d:
                print(ans_d)
                return 0
        elif ans_b <= ans_c:
            if ans_d <= ans_c:
                print(ans_c)
                return 0
            elif ans_c <= ans_d:
                print(ans_d)
                return 0
        
    if ans_b <= ans_a:
        if ans_c <= ans_a:
            if ans_d <= ans_a:
                print(ans_a)
                return 0
            elif ans_a <= ans_d:
                print(ans_d)
                return 0
        elif ans_a <= ans_c:
            if ans_d <= ans_c:
                print(ans_c)
                return 0
            elif ans_c <= ans_d:    
                print(ans_d)
                return 0
main()

Submission status: Accepted

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

q=a*c
w=a*d
e=b*c
r=b*d

ans=max(q,w,e,r)
print(ans)