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

if a * d > ans:
    ans = a * d

if b * c > ans:
    ans = b * c

if b * d > ans:
    ans = b * d

print(ans)

Submission status: Accepted

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

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

a=[]
a.append(ans1)
a.append(ans2)
a.append(ans3)
a.append(ans4)

print(max(a))

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 itertools

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

x = [a, b]
y = [c, d]

ans = []

prod = itertools.product(x,y)
for i in prod:
    ans.append(i[0]*i[1])

print(max(ans))

Submission status: Accepted

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

result = []
result.extend([a*c, a*d, b*c, b*d])

#print(result)
print(max(result))

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())
n1=[]
if a<=0 and b>=0:
    n1.append(0)
elif c<=0 and d>=0:
    n1.append(0)
n1.append(a*c)
n1.append(a*d)
n1.append(b*c)
n1.append(b*d)
print(max(n1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abcd  = input('').split()

a=int(abcd[0])
b=int(abcd[1])
c=int(abcd[2])
d=int(abcd[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 = map(int, input().split())

l = [a*c, a*d, b*c, b*d]
answer = l[0]
for i in l:
  if answer < i:
    answer = i

print(answer)

Submission status: Accepted

Solution code:
N = list(map(int,input().split()))
ans = -10000000000000000000

for i in range(2):
    for j in range(2):
        result = N[i]*N[j+2]
        if ans < result:
            ans = result

print(ans)

Submission status: Accepted

Solution code:
# by the authority of GOD
import os,sys
from io import BytesIO, IOBase

def main():
    a,b,c,d=map(int,input().split())
    print(max(b*d,b*c,c*a,d*a))
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math,bisect
sys.setrecursionlimit(10 ** 5)
from collections import defaultdict
from itertools import groupby,accumulate
from heapq import heapify,heappop,heappush
from collections import deque,Counter,OrderedDict
def I(): return int(sys.stdin.readline())
def neo(): return map(int, sys.stdin.readline().split())
def Neo(): return list(map(int, sys.stdin.readline().split()))
a,b,c,d = neo()
print(max(max(a,b)*max(c,d),min(a,b)*max(c,d),max(a,b)*min(c,d),min(a,b)*min(c,d)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = max(e)

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

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def NLI(n):return [[int(i) for i in input().split()] for i in range(n)]
def NLI_(n):return [[int(i)-1 for i in input().split()] for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def RLI(n=8,a=1,b=10):return [random.randint(a,b)for i in range(n)]
def RI(a=1,b=10):return random.randint(a,b)
def INP():
    N=10;A=10
    n=random.randint(1,N)
    a=[random.randint(1,A) for i in range(n)]
    return n,a
def Rtest(T):
    case,err=0,0
    for i in range(T):
        inp=INP()
        a1=naive(*inp)
        a2=solve(*inp)
        if a1!=a2:
            print((a1,a2),inp)
            err+=1
        case+=1
    print('Tested',case,'case with',err,'errors')
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
#mo=998244353
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**9)
read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()


class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

show_flg=False
show_flg=True

ans=-inf

a,b,c,d=LI()

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

print(ans)

Submission status: Accepted

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re

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

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:
def main():
    a, b, c, d = list(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())
ab_list = [a, b]
cd_list = [c, d]
ans_list = []
for i in ab_list:
    for j in cd_list:
        ans_list.append(i*j)
print(max(ans_list))

Submission status: Accepted

Solution code:
def cal(a,b,c,d):
    list = []
    list.append(a*c)
    list.append(b*c)
    list.append(a*d)
    list.append(b*d)
    new_list = sorted(list, reverse=True)
    print(new_list[0])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
a = l[:2]
c = l[2:]
ans = -float('INF')
for i in a:
  for j in c:
    ans = max(ans, i*j)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(max(mult_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
import math
import numpy as np
from decimal import Decimal
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul	# 
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd	# 最大公約数
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.maxsize = 10 ** 15
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

a,b,c,d = MAP()

a1 = a*c
a2 = a*d
a3 = b*c
a4 = b*d

if a1 >= a2:
    b1 = a1
else:
    b1 = a2

if a3 >= a4:
    b2 = a3
else:
    b2 = a4

if b1 >= b2:
    print(b1)
else:
    print(b2)

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


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

ans = max(x)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,c,d=list(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:
i = list(map(int, input().split()))
j = [i[0] * i[2], i[0] * i[3], i[1] * i[2], i[1] * i[3]]

print(sorted(j, reverse=True)[0])

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

Submission status: Accepted

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


ans = []
for i in range(0, 2):
    for j in range(2, 4):
        ans.append(L[i] * L[j])

print(max(ans))

Submission status: Accepted

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

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

print(max(anslist))

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 = [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(' '))

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

max_num = num[0]

for i in range(4):
    if num[i] >= max_num:
        max_num = num[i]

print(max_num)

Submission status: Accepted

Solution code:
import math

inp = list(map(int, input().rstrip().split()))

xL = inp[:2]
yL = inp[2:]

_max = -1 * math.inf
for i in xL:
    for j in yL:
        if i * j > _max:
            _max = i * j

print(_max)

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

L = [A,B,C,D]

print(max(L))

Submission status: Accepted

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

a, b, c, d = map(int, readline().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 = a * c
i_list = [a,b]
j_list = [c,d]
for i in  i_list:
    for j in j_list:
        ans = max(ans, i*j)
        
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

numList = []
result = []

user2 = list(map(int, input().split()))


numList.append(user2[0] * user2[2] )
numList.append(user2[0] * user2[3]) 
numList.append(user2[1] * user2[2]  )
numList.append (user2[1] * user2[3])

numList.sort()

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

print(max(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split(' ')
result = []
result.append(int(a[0]))
result.append(int(a[1]))
result.append(int(a[2]))
result.append(int(a[3]))
subresult = []
subresult.append(result[0]*result[2])
subresult.append(result[0]*result[3])
subresult.append(result[1]*result[2])
subresult.append(result[1]*result[3])
print(max(subresult))

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

x = [a,b]
y = [c,d]
n = []
n0 = a*c
n1 = b*d
n2 = b*c
n3 = a*d

n = max(n0, n1, n2, n3)

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a,b,c,d=map(int, sys.stdin.readline().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()))

x = max(a*c,a*d)
y = max(b*c,b*d);
print(max(x,y))

Submission status: Accepted

Solution code:
import sys
import itertools as it

a, b, c, d = [int(a) for a in sys.stdin.readline().strip().split()]

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


ret = a * c
for x, y in it.product(l1, l2):
    ret2 = x * y
    if ret < ret2:
        ret = ret2
print(ret)

Submission status: Accepted

Solution code:
def resolve():
    from itertools import product
    a, b, c, d = map(int, input().split())
    m = - (10 ** 18)
    for c in product([a, b], [c, d]):
        m = max(m, c[0] * c[1])

    print(m)
    
resolve()

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:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
 


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


   
if __name__ == "__main__":
    main()

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)

c = sorted(l)
print(c[3])

Submission status: Accepted

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

v = a * c
w = a * d
x = b * c
y = b * d

i = max(v, w)
j = max(x, y)

print(max(i, j))

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())
mi=a*c
mm=a*d
aa=b*c
ma=b*d
print(max(mi,ma,mm,aa))

Submission status: Accepted

Solution code:
#akash mandal: jalpaiguri government engineering college
import sys,math

def ii(): return int(input())
def mii(): return map(int,input().split())
def lmii(): return list(mii())


def main():
    a,b,c,d=mii()
    if a>b:
        a,b=b,a
    if c>d:
        c,d=d,c
    print(max(a*c,b*d,a*d,b*c))
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    from sys import stdin

    readline = stdin.readline

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

    l=list()

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

    print(max(l))

main()

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split()) 
x = max(a*c,b*d,a*d,b*c)
print(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())
s=[]
for x in (a,b):
    for y in (c,d):
        k=x*y
        s.append(k)
print(max(s))

Submission status: Accepted

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

n1= a*c
n2= a*d
n3= b*c
n4= b*d

print(max(n1,n2,n3,n4))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

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:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

Submission status: Accepted

Solution code:
import math

a,b,c,d = map(int,input().split( ))
a,b,c,d = math.ceil(a),math.floor(b),math.ceil(c),math.floor(d)
print(max([a*c,a*d,b*c,b*d]))

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")


a, b, c, d = gil()
ans = -inf
for i in [a, b]:
	for j in [c, d]:
		ans = max(ans, i*j)
        
if a <= 0<=b or c <= 0 <= d :
	ans = max(0, ans)
    
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = [int(e) for e in 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())

# 掛け算が負になるなら最も0に近い数が解
# 正になる組み合わせが存在するなら最も大きい数
ac = a*c
ad = a*d
bc =b*c
bd=b*d

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

Submission status: Accepted

Solution code:
import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque 

input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def dbg(o):
    print(o, file=sys.stderr)

# ---------------------------------------

a, b, c, d = inpl()
INF = 10**20

ls = []
ls.append(a*c)
ls.append(b*c)
ls.append(a*d)
ls.append(b*d)
mx = -INF
for i in ls:
    mx = max(mx, i)
print(mx)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import subprocess
import os
import time


import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

# 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())
ans = -(10 ** 20)

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

print(ans)

Submission status: Accepted

Solution code:
hako=list(map(int,input().split()))
hk=[]
A=hako[0]*hako[2]
B=hako[0]*hako[3]
C=hako[1]*hako[2]
D=hako[1]*hako[3]
hk.append(A)
hk.append(B)
hk.append(C)
hk.append(D)
hk.sort()
print(hk.pop())

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:
A = list(map(int, input().split()))
ans_1 = A[0]*A[2]
ans_2 = A[0]*A[3]
ans_3 = A[1]*A[2]
ans_4 = A[1]*A[3]
answers = [ans_1,ans_2,ans_3,ans_4]
print(max(answers))

Submission status: Accepted

Solution code:
""" B
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return [readIntegerSet(m) for _ in range(0, n)]

def main(_a, _b, _c, _d):
    return max([_a * _c, _a * _d, _b * _c, _b * _d])


if __name__ == "__main__":
    _a, _b, _c, _d = readIntegerSet(4)

    print(main(_a, _b, _c, _d))

Submission status: Accepted

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

# x, y の min, max総当たり
ans = a * c
for i, j in product([a, b], [c, d]):
    # print(i, j)
    ans = max(ans, i * j)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test=""):
    try:
        a, b, c, d = map(int, input().split())

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

        if a <= 0 <= b or c <= 0 <= d:
            aaa.append(0)

        print(max(aaa))

    except IndexError as err:
        print("インデックスエラー:", err.args[0])


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """1 2 1 1"""
        output = """2"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """3 5 -4 -2"""
        output = """-6"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """-1000000000 0 -1000000000 0"""
        output = """1000000000000000000"""
        self.assertIO(test_input, output)

    # 自作テストパターン
    def test_original(self):
        pass


# youk_debug_library
def list_to_tsv(target: [], limit_row: int = 0, limit_column: int = 0) -> str:
    # 行列を制限の範囲内に絞り込む
    if limit_row is not 0:
        target = target[:limit_row]
    if limit_column is not 0:
        target = [i[:limit_column] for i in target]

    # 行番号、列番号を追加
    target = [[cnt] + i for cnt, i in enumerate(target)]  # 行番号
    target.insert(0, [i for i in range(len(target[0]))])  # 列番号
    # tsv形式で出力
    result = ""
    for a in target:
        result += '\t'.join(map(str, a)) + '\r\n'
    return result


# 実装orテストの呼び出し処理
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main(verbosity=2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=[int(x) for x in input().split()]
#print(a)
ans1=a[0]*a[2]
ans2=a[0]*a[3]
ans3=a[1]*a[2]
ans4=a[1]*a[3]
if(ans1>ans2):
    b=ans1
else:
    b=ans2
if(b<ans3):
    b=ans3
if(b<ans4):
    b=ans4
print(b)

Submission status: Accepted

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

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

ans.sort()

print(ans[-1])