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

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

Submission status: Accepted

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

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

f=b*d
g=b*e
h=c*d
i=c*e

if f>g:
  if h>f:
    if i>h:
      print(i)
    else:
      print(h)
  else:
    if i>f:
      print(i)
    else:
      print(f)
else:
  if h>g:
    if i>h:
      print(i)
    else:
      print(h)
  else:
    if i>g:
      print(i)
    else:
      print(g)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline  # 文字列読み込む時はこっち
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(readline())


def ints(): return list(map(int, readline().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, readline().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, readline().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, readline().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce
from math import gcd


def lcm(a, b):
    # 最小公倍数
    g = gcd(a, b)
    return a // g * b


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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, open(0).read().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<=0 and b>=0 or (c<=0 and d>=0)):
  print(max(a*c,b*d,a*d,b*c,0))
else:
  print(max(a*c,b*d,a*d,b*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())
net = []
net.append(a * c)
net.append(a * d)
net.append(b * c)
net.append(b * d)
print(max(net))

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

result_a = ac if ac > ad else ad
result_b = bc if bc > bd else bd

print(result_a if result_a > result_b else result_b)

Submission status: Accepted

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

a = int(arr[0])
b = int(arr[1])

c = int(arr[2])
d = int(arr[3])

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

ans = max(tmp)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import defaultdict
from collections import deque
import bisect
from decimal import *
def main():
    a, b, c, d = MI()
    print(max(a * c, b * d, a * d, b * c))
if __name__ == "__main__":
    main()

Submission status: Accepted

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

one=[a,b]
two=[c,d]
aha=a*c
ihi=a*d
uhu=b*c
ehe=b*d
print(max([aha,ihi,uhu,ehe]))

Submission status: Accepted

Solution code:
a,b,c,d = map(int, input().split())
ans = -(10**20)
for i in (a,b):
  for j in (c,d):
    ans = max(ans,i*j)
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:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#a = int(input())
	a,b,c,d = tin()
	#s = input()
	return max(a*c, a*d,b*c, b*d)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

answers = []

one = a*c
two = a*d
three = b*c
four = b*d

answers.append(one)
answers.append(two)
answers.append(three)
answers.append(four)

print(max(answers))

Submission status: Accepted

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

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

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

print(max(list))

Submission status: Accepted

Solution code:
x=input().split(" ")
z=[]
for i in range(2):
	z.append(int(x[i-2])*int(x[0]))
for i in range(2):
    z.append(int(x[i-2])*int(x[1]))
print(max(z))

Submission status: Accepted

Solution code:
def main():
   a,b,c,d=map(int,input().split())
   p1=a*c
   p2=a*d
   p3=b*c
   p4=b*d
   x=max(p1,p2)
   y=max(p3,p4)
   print(max(x,y))

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if(a<0 and 0<b):
    l1.append(0)
if(c<0 and 0<d):
    l2.append(0)

l = []
for x in l1:
    for y in l2:
        l.append(x*y)

print(max(l))

Submission status: Accepted

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

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())
ans = max(a*c, b*d, a*d, b*c)
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:
number = list(map(int, input().split(" ")))

answer = []

answer.append(number[0] * number[2])
answer.append(number[0] * number[3])
answer.append(number[1] * number[2])
answer.append(number[1] * number[3])

print(max(answer))

Submission status: Accepted

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

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

ans = - 10 ** 18
for i in range(4):
    if multi[i] > ans:
        ans = multi[i]

print(ans)

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 = map(int, input().split())

ans = -float("INF")  # 答えがマイナスになることがあるので、負の無限大を初期値にしておきます

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/python3

def get_ints():
    return list(map(int, input().split()))

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

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 = map(int,input().split())
ans = -10**20
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:
import numpy as np
import sys

if __name__ == "__main__":
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = 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())
n = [0]*4
n[0] = a * c
n[1] = a * d
n[2] = b * c
n[3] = b * d

print(max(n))

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:
a, b, c, d = (int(i) for i in input().split())

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
x = a[:2]
y = a[2:]
num = []
for i in x:
  for j in y:
    num.append(i * j)
    
  
print(max(num))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(max(nums))

Submission status: Accepted

Solution code:
nums=list(map(int, input().split()))
ans=[]
for i in range(2):
  ans.append(nums[i]*nums[2])
  ans.append(nums[i]*nums[3])
print (max(ans))

Submission status: Accepted

Solution code:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

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

Submission status: Accepted

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

print(_max)

Submission status: Accepted

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

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(" "))
print(max([i for i in [i*j for i in (a, b) for j in (c,d)]]))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
#from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *
from bisect import *	
#from heapq import *
#from math import ceil
#from itertools import permutations ,product
 
def eprint(*args):
    print(*args, file=sys.stderr)
zz=1
 
#sys.setrecursionlimit(10**6)
if zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('all.txt','w')
di=[[-1,0],[1,0],[0,1],[0,-1]]
def inc(d,c,x=1):
	d[c]=d[c]+x if c in d else x
def bo(i):
	return ord(i)-ord('A')	
def li():
	return [int(xx) for xx in input().split()]
def fli():
	return [float(x) for x in input().split()]	
def comp(a,b):
	if(a>b):
		return 2
	return 2 if a==b else 0		
def gi():	
	return [xx for xx in input().split()]
def fi():
	return int(input())
def pro(a): 
	return reduce(lambda a,b:a*b,a)		
def swap(a,i,j): 
	a[i],a[j]=a[j],a[i]	
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())			
def gh():
	sys.stdout.flush()
def isvalid(i,j):
	return 0<=i<n and 0<=j<m and a[i][j]!="."
def bo(i):
	return ord(i)-ord('a')	
def graph(n,m):
	for i in range(m):
		x,y=mi()
		a[x].append(y)
		a[y].append(x)
def represent(n):
	s=""
	while n>0:
		s+=str(n%3)
		n//=3
	s=s[::-1]
	return s			

t=1
while t>0:
	t-=1
	a,b,c,d=mi()
	maxi=-10**19
	for i in a,b:
		for j in c,d:
			maxi=max(maxi,i*j)		
	print(maxi)

Submission status: Accepted

Solution code:
a,b,c,d=(int(x) for x in 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())
print(max(a*c, b*d, a*d, b*c))

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

p = a * c
o = a * d
i = b * c
u = b * d

print(max(p, o, i, u))

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()))
c=-10**100
for i in range(2):
  for j in range(2,4):
    b=a[i]*a[j]
    if b>c:
      c=b
print(c)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

a, b, c, d = LI()

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

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

print(max(cal))

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
e = a*c
f = a*d
g = b*c
h = b*d
xy =[e,f,g,h]
print(int(max(xy)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x_low,x_up,y_low,y_up=map(int,input().split())

a1=x_low*y_low
a2=x_low*y_up
a3=x_up*y_low
a4=x_up*y_up

ans=max(a1,a2,a3,a4)
print(ans)

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

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

print(max(ans))

Submission status: Accepted

Solution code:
A, B, C, D = input().split()
 
AC = int(A)*int(C)
AD = int(A)*int(D)
BC = int(B)*int(C)
BD = int(B)*int(D)

 
l = [AC, AD, BC, BD]

print(max(l))

Submission status: Accepted

Solution code:
import math
from decimal import *
import random

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

Submission status: Accepted

Solution code:

def main(a, b, c, d):
    ans = -float('inf')
    for x in [a, b]:
        for y in [c, d]:
            z = x * y
            if ans < z:
                ans = z
    return ans

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

Submission status: Accepted

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

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 = 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 = map(int,input().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#n = int(input()) #入力
#a, b = (int(x) for x in input().split())
#a, b = map(int, input().split())

#a = [int(x) for x in input().split()]
#a = list(map(int, input().split()))
#a = [list(map(int,input().split(" "))) for i in range(N)]   #2次元


#a.sort() # C++ の sort(a.begin(), a.end());
#a.append(3) # C++ の a.push_back(3);


#exit(0) # return 0 的な。終了できる。
## 整数の切り捨て除算は // (ダブルスラッシュ)


#a[始まりの位置: 終わりの位置: スライスの増分] # (a は配列)


import numpy as np
import math
import copy
import string
#math.gcd(a, b) で、gcd 計算できる。
#math.pi は円周率。

INF = 10**18 #べき乗 C++ の pow(10, 18) or 1e18;
pi = math.pi

MOD = 1000000007
#MOD = 1000000009
#MOD = 998244353




#繰り返し2乗法
#N^aの、Mで割った余りを求める。
def my_pow(N, a, M):
    if(a == 0):
        return 1
    else:
        if(a % 2 == 0):
            tempo = my_pow(N, a/2, M)
            return (tempo * tempo) % M
        else:
            tempo = my_pow(N, a - 1, M)
            return (tempo * N) % M




#N_C_a を M で割った余り
def my_combination(N, a, M):
    res = 1

    for i in range(0, a):
        res *= N - i
        res %= M

    for i in range(0, a):
        res *= my_pow(i + 1, M - 2, M)
        res %= M

    return res




#N_C_i を M で割った余りを、v[i] に代入する。
def my_combination_table(N, M, v):
    if(len(v) < N + 1):
        l = N + 1 - len(v)
        tempo = [1] * l
        v.extend(tempo)

    for i in range(1, N + 1):
        v[i] = v[i - 1] * (N - (i - 1))
        v[i] %= M

        v[i] *= my_pow(i, M - 2, M)
        v[i] %= M

    return




#math.factorial で階乗は計算できる。
#math.gcd で gcd は計算できる。
#np.gcd.reduce(A) #(Aは配列) で、Aの全ての要素の gcd が計算できる。



a, b, c, d = (int(x) for x in input().split())
res = int(b * d)
res = max(res, a * c)
res = max(res, a * d)
res = max(res, b * c)

if(a <= 0 and 0 <= b):
    res = max(res, 0)
if(c <= 0 and 0 <= d):
    res = max(res, 0)


print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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 = map(int,input().split())
k = max(a*c,b*d)
l = max(a*d,b*c)
print(max(k,l))

Submission status: Accepted

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

cands = [a*c, a*d, b*c, b*d]
if a * b <= 0 or c * d <= 0:
    cands.append(0)

print(max(cands))

Submission status: Accepted

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

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

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

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

max_a = max(ac, ad)
max_b = max(bc, bd)

print(max(max_a, max_b))

Submission status: Accepted

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

res = float("-inf")

for i in [a,b]:
    for j in [c,d]:
        res = max(i * j, res)
        
print(res)

Submission status: Accepted

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

max_pro = -float("inf")
for i in range(2):
  for j in range(1,3):
    product = abcd[i] * abcd[-j]
    if max_pro < product:
      max_pro = product

print(max_pro)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b, c, d = M()
li = list()
li.append(a*c)
li.append(a*d)
li.append(b*c)
li.append(b*d)
li.sort()
print(li[-1])

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

lst = [ [a,b], [c,d] ]
mx = a*c
for i in range(2):
  x = lst[0][i]*lst[1][0]
  if x >= mx:
    mx = x
  x = lst[0][i]*lst[1][1]
  if x >= mx:
    mx = x
print(mx)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
ab=list([a,b])
cd=list([c,d])
ans=ab[0]*cd[0]
for i in range(len(ab)):
    for j in range(len(cd)):
        temp=ab[i]*cd[j]
        ans=max(ans,temp)
print(ans)

Submission status: Accepted

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

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

m()

Submission status: Accepted

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

m()

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

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:
import numpy as np
a = list(map(int, input().split()))
ans = -1*float('inf')
y = np.array(a[2:])
for i in a[:2]:
  ans = max(ans, max(i*y))
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import itertools
    a,b,c,d = map(int,input().split())
    ans = -1 * float('inf')
    if a*c>ans:
        ans = a*c
    if a*d>ans:
        ans = a*d
    if b*c > ans:
        ans = b*c
    if b*d>ans:
        ans = b*d
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
def getmax(a,b):
    if a>b:
        return a
    else:
        return b
def getmin(a,b):
    if a<b:
        return a
    else:
        return b
if (a>0 and b>0 and c<0 and d<0) or (a<0 and b<0 and c>0 and d>0):
    x = getmin(a,b)
    y = getmax(c,d)
    max = x*y
    x = getmax(a,b)
    y = getmin(c,d)
    min = x*y
    if max > min:
        print(max)
    else:
        print(min)
else:
    x = getmax(a,b)
    y = getmax(c,d)
    max = x*y
    x = getmin(a,b)
    y = getmin(c,d)
    min = x*y
    if max > min:
        print(max)
    else:
        print(min)

Submission status: Accepted

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

Submission status: Accepted

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

A = [a,b]
B = [c,d]
INF = float("INF")
M = -INF

for i in A:
    for j in B:
        M = max(i*j,M)
print(M)

Submission status: Accepted

Solution code:

def solve():
    a,b,c,d=[int(v) for v in input().split()]
    print(max(a*c, a*d, b*c, b*d))

t = 1 #int(input())
for _ in range(t):
    solve()

Submission status: Accepted

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

main()

Submission status: Accepted

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

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

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 = map(int, input().split())

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

print(max(array))

Submission status: Accepted

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

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())
e=a*c
f=a*d
g=b*c
h=b*d
MAX=max(e,f,g,h)
print(MAX)

Submission status: Accepted

Solution code:
a = input().split(" ")

x = [int(a[0]),int(a[1])]
y = [int(a[2]),int(a[3])]

ans = []

for i in x:
  for j in y:
    s = i*j
    
    ans.append(s)
ans.sort(reverse = True)  
print(ans[0])

Submission status: Accepted

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