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

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

ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d
print(max(ans1,ans2,ans3,ans4))

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:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
#sort = sorted(a)[::-1] 降順
#if l[i] == l[j]: continue
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())

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

print(max(ans1,ans2,ans3,ans4))

Submission status: Accepted

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

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

if __name__=="__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(max(r))

Submission status: Accepted

Solution code:
a,b,c,d = list(map(int, input().split()))
         
A = a * c
B = a * d
C = b * c
D = b * d

print(max(A,B,C,D))

Submission status: Accepted

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

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

x = [ac,ad,bc,bd]
x.sort()

print(x[3])

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

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

a = A * C
b = A * D
c = B * C
d = B * D

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

Submission status: Accepted

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

_max = -float("inf")
for i in [a, b]:
    for j in [c, d]:
        if _max < i * j:
            _max = i * j
print(_max)

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

if ac>ad and ac>bc and ac>bd:
  print(ac)
elif ad >bc and ad>bd and ad>ac:
  print(ad)
elif bc>ac and bc>ad and bc>bd:
  print(bc)
else:
  print(bd)

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:
from sys import stdin
a, b, c, d = [int(x) for x in stdin.readline().rstrip().split()]
A = []
A.append(a * c)
A.append(a * d)
A.append(b * c)
A.append(b * d)
m = max(A)
print(m)

Submission status: Accepted

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

from itertools import combinations

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

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

if a <= 0 <= b or c <= 0 <= d:
    ans = max(ans, 0)

print(ans)

Submission status: Accepted

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

a_c = a * c
a_d = a * d
b_c = b * c
b_d = b * d

list_ans = [a_c, a_d, b_c , b_d]

print(max(list_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()))

anss = []

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

print(max(anss))

Submission status: Accepted

Solution code:
from itertools import combinations
import numpy as np
a,b,c,d =  map(int, input().split())
ans = -np.inf
ans = max(a*d, ans)
ans = max(a*c, ans)
ans = max(b*c, ans)
ans = max(b*d, ans)
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:
import math

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


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:
import numpy as np

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

xy1=a*c
xy2=a*d
xy3=b*c
xy4=b*d

xymax=max([xy1,xy2,xy3,xy4])
print (xymax)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

lis = []
lis.append(a * c)
lis.append(a * d)
lis.append(b * c)
lis.append(b * d)
print(max(lis))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

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

L = list()

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

a1 = a*c
a2 = b*d
a3 = c*b
a4 = a*d
ans = max(max(a1,a2),max(a3,a4))
print(ans)

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math
import collections
import copy
import decimal
import itertools
from collections import deque 
from functools import reduce
from itertools import product
from itertools import combinations
 
# input = sys.stdin.readline

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

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

print(max(res))

Submission status: Accepted

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

main()

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


print(max([A, B, C, D]))

Submission status: Accepted

Solution code:
# from pprint import pprint
# import math
# import collections

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

Submission status: Accepted

Solution code:
import sys
from sys import stdin,stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache
#@lru_cache(maxsize=None) #for optimizing the execution time of callable objects/functions(placed above callable functions)
try:
    for _ in range(1):
        a,b,c,d=map(int,input().split())
        if a>0 and c>0:
            print(b*d)
        else:
            print(max([a*c,a*d,b*c,b*d]))





    
except EOFError as e:
    print(e)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a1 = a*c
a2 = a*d

a3 = b*c
a4 = b*d


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

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:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=int(1e9)+7

###############################################################################\n=17
a,b,c,d=INPUT()
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())
x = [a,b]
y = [c,d]

if a * b < 0:
    x.append(-1)
    x.append(1)
    
if c * d < 0:
    y.append(-1)
    y.append(1)
    
ans = - (10 ** 20)
    
for i in x:
    for j in y:
        ans = max((i*j),ans)
        
print(ans)

Submission status: Accepted

Solution code:
# x = int(input())
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())
ans1 = a*c
ans2 = a*d
ans3 = b*c
ans4 = b*d
print(max(ans1, ans2, ans3, ans4))

Submission status: Accepted

Solution code:


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

li = []

li.append(lis[0] * lis[2])
li.append(lis[0] * lis[3])
li.append(lis[1] * lis[2])
li.append(lis[1] * lis[3])

print(max(li))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
r = None
for x in (a, b):
    for y in (c, d):
        rr = x * y
        r = rr if r is None else max(r, rr)
print(r)

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:
#B
ls = list(map(int, input().split()))
ans = max([ls[0]*ls[2], ls[0]*ls[3], ls[1]*ls[2], ls[1]*ls[3]])

print(ans)

Submission status: Accepted

Solution code:
'''
Created on 2020/09/13

@author: okazakieiichiro
'''

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

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

ansList = [ans1, ans2, ans3, ans4]

max = None
for ans in ansList:
    if max is None:
        max = ans
    elif max <ans:
        max = ans

print(max)

Submission status: Accepted

Solution code:
import math
import sys
import os

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


a,b,c,d = LI()
ans = -INF
ans = max(ans,a*c)
ans = max(ans,b*d)
ans = max(ans,b*c)
ans = max(ans,a*d)

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())
ac = a*c
ad = a*d
bc = b*c
bd = b*d
l = [ac, ad, bc, bd]
print(max(l))

Submission status: Accepted

Solution code:
import numpy as np
data = [int(x) for x in input().split(" ")]

a1 = data[0] * data[2]
a2 = data[0] * data[3]
a3 = data[1] * data[2]
a4 = data[1] * data[3]

print(np.array([a1, a2, a3, a4]).max())

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:
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())
p = max(a,b)*max(c,d)
q = max(a,b)*min(c,d)
r = min(a,b)*max(c,d)
s = min(a,b)*min(c,d)
print(max(p,q,r,s))

Submission status: Accepted

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

Submission status: Accepted

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

(a, b, c, d) = (int(i) for i in input().split())

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

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

print(m)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    a, b, c, d = input_int_list()
    ans = max(a * c, a * d, b * c, b * d)
    print(ans)

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

pre = [a*c,a*d,b*c,b*d]
ans= max(pre)
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
if e < f:
    e = f
if e < g:
    e = g
if e < h:
    e = h
print(e)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# region header
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
import copy
# @lru_cache(maxsize=None)
# sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
# endregion
# region input function


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


# endregion
a, b, c, d = inpl()
ans = -INF
tmp = [a * c, b * c, a * d, b * d]
if (a <= 0 and b >= 0)or (c <= 0 and d >= 0):
    ans = 0
else:
    ans = -INF
tmp = max(tmp)
ans = max(ans, tmp)
print(ans)

Submission status: Accepted

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

def main(a,b,c,d):
    xy1=a*c
    xy2=a*d
    xy3=b*c
    xy4=b*d
    return max(xy1,xy2,xy3,xy4)

if __name__=='__main__':
    a,b,c,d=readinput()
    ans=main(a,b,c,d)
    print(ans)

Submission status: Accepted

Solution code:
import sys
arr = [int(x) for x in input().split()]

arr1 = [arr[0], arr[1]]
arr2 = [arr[2], arr[3]]

ans = -1*sys.maxsize

for i in arr1:
	for j in arr2:
		ans = max(ans, i*j)

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())
print(max([B*D,A*C,A*D,B*C]))

Submission status: Accepted

Solution code:
import math
a, b, c, d = map(int,input().split())
#AB=[]
#N = int(input())
#C = input()
#D, T, S=map(int,input().split())
#C = []
#for i in range(N):
#    C.append(list(map(int,input().split())))
print(max(max(max(a*c, a*d),b*c),b*d))

Submission status: Accepted

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

ans = []
for x in [0,1]:
    for y in [2,3]:
        ans.append(n[x]*n[y])
print(max(ans))

Submission status: Accepted

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

print(max(res, f))

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

test=[ac,ad,bc,bd]

print(max(test))

Submission status: Accepted

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

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

res = a * c
for x, y in [[a, d], [b, c], [b, d]]:
    if x * y > res:
        res = x * y

print(res)

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
x = []
t = a*c
r = a*d
p = b*c
q = b*d
z = max(t,r,p,q)
print(z)

Submission status: Accepted

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

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

M = max(A)

print(M)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding:utf-8

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


"""
方針


"""


def solve(a, b, c, d):
    ac = a * c
    ad = a * d
    bc = b * c
    bd = b * d
    l = [ac, ad, bc, bd]
    m = max(l)
    return m


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    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, 0))
    else:
        print(max(a*c, b*d, a*d, b*c))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = (int(i) for i in input().split())
    ans = max(a * c, b * d, a * d, b * c)
    if ans < 0 and (a <= 0 <= b or c <= 0 <= d):
        ans = 0
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

list1 = [a, b]
list2 = [c, d]

max = list1[0] * list2[0]

for n1 in list1:
  for n2 in list2:
    if max < (n1 * n2):
      max = n1 * n2

print(max)

Submission status: Accepted

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

Submission status: Accepted

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

l = []

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

print(max(l))

Submission status: Accepted

Solution code:
# 初期入力
import sys
import math 
input = sys.stdin.readline  #文字列では使わない
a,b,c,d = map(int, input().split())
ans =0
if 0 <= a and 0 <= c:
    ans =b*d
elif b <=0  and d <=0 :
    ans =a*c
else:
    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 = b*d

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

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

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

print(ans)

Submission status: Accepted

Solution code:
min_x, max_x, min_y, max_y = map(int, input().split())

print(max(min_x * min_y, max_x * max_y, min_x * max_y, max_x * min_y))

Submission status: Accepted

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

ans = a * c
for x in ([a, b]):
    for y in ([c, d]):
        # print(f"{x} {y}")
        ans = max(ans, x * y)
        
print(ans)

Submission status: Accepted

Solution code:
def cin():  return list(map(int,input().split()))

a, b, c, d = cin()
ans1 = a * c
ans2 = a * d
ans3 = b * c
ans4 = b * d
ans = max(ans1, ans2, ans3, ans4)
if((a <= 0 and b >= 0) or (c <= 0 and d >= 0)): ans = max(ans, 0)
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())
ans=max(a,b)*max(c,d)
ans3=min(a,b)*max(c,d)
ans4=max(a,b)*min(c,d)
ans2=min(a,b)*min(c,d)
print(max(ans,ans2,ans3,ans4))

Submission status: Accepted

Solution code:
import sys,math,collections
from collections import defaultdict

#from itertools import permutations,combinations
    
def file():
    sys.stdin = open('input.py', 'r')
    sys.stdout = open('output.py', 'w') 
def get_array():
    l=list(map(int, input().split()))
    return l
def get_ints():   
    return map(int, input().split())
    #return a,b
def get_3_ints():   
    a,b,c=map(int, input().split())
    return a,b,c    
def sod(n):
    n,c=str(n),0
    for i in n: 
        c+=int(i)
    return c    
def isPrime(n):
    if (n <= 1):
        return False
    if (n <= 3):
        return True
    if (n % 2 == 0 or n % 3 == 0):
        return False
    i = 5
    while(i * i <= n):
        if (n % i == 0 or n % (i + 2) == 0):
            return False
        i = i + 6
  
    return True
def getFloor(A, x):

    (left, right) = (0, len(A) - 1)

    floor = -1
    while left <= right:
        mid = (left + right) // 2
        if A[mid] == x:
            return A[mid]
        elif x < A[mid]:
            right = mid - 1
        else:
            floor = A[mid]
            left = mid + 1
            
    return floor
def chk(aa,bb):
	f=0
	for i in aa:
		for j in bb:
			if(j[0]>=i[0] and j[1]<=i[1]):
				f+=1
			elif(j[0]<=i[0] and j[1]>=i[1]):	
				f+=1
			elif(i[0]==j[1] or i[1]==j[0]):
				f+=1
			else:
				continue
	return f			

#file()
def main():
	a,b,c,d=get_ints()
	
	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())
x1 = a*c
x2 = a*d
x3 = b*c
x4 = b*d
lst = [x1,x2,x3,x4]
print(max(lst))

Submission status: Accepted

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

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

# if a <= 0 and c <= 0:
#     ans = max(ans,a*c)

# print(ans)

Submission status: Accepted

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

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

a = l[0]
b = l[1]
c = l[2]
d = l[3]

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

hantei = [ac, ad, bc, bd]

print(max(hantei))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from functools import lru_cache
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    a, b, c, d = read_values()
    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())
ac=a*c
ad=a*d
bc=b*c
bd=b*d
print(max(ac,ad,bc,bd))

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
n_max = n[0] * n[2]
for i in range(0, 2):
    for j in range(2, 4):
        if n_max < n[i] * n[j]:
            n_max = n[i] * n[j]
print(n_max)

Submission status: Accepted

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
    
def solve():
    a,b,c,d = invr()
    print(max(a * c,b * d,a * d,b * c))
    
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)

def counter_elements(a):
    q = dict()
    for i in range(len(a)):
        if a[i] not in q:
            q[a[i]] = 0
        q[a[i]] = q[a[i]] + 1
    return(q)

def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)
 
def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))
 
def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

def transpose(a):
    n,m = len(a),len(a[0])
    b = [[0] * n for i in range(m)]
    for i in range(m): 
        for j in range(n): 
            b[i][j] = a[j][i]
    return(b)

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

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

print(max(max(max(A, B), C), D))

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = A * C
ans2 = A * D
ans3 = B * C
ans4 = B * D


ans = max(ans1, ans2, ans3, ans4)
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))

x=max(a,b)
y=max(c,d)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(max(A))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(m)