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

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

print(max(li))

Submission status: Accepted

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

main()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

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

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

print(max(arr))

Submission status: Accepted

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

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

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

print(max(prod))

Submission status: Accepted

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

A = []

for i in [a, b]:
    for j in [c, d]:
        A.append(i * j)
print(max(A))

Submission status: Accepted

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

Submission status: Accepted

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

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

list1 = [e, f, g, h]
max = max(list1)
print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
x = [a, min(a+1, b), max(a, b-1), b]
y = [c, min(c+1, d), max(c, d-1), d]

ans = -int(1e19)
for i in x:
  for j in y:
    ans = max(ans, i*j)
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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())
ans = max(a * c, a * d, b * c, b * d)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    INP = list(map(int, input().split()))
    list1 = [INP[0],INP[1]]
    list2 = [INP[2],INP[3]]
    if INP[0] < 0 and INP[1] > 0:
        list1.extend([-1,0,1])
    if INP[2] < 0 and INP[3] > 0:
        list2.extend([-1,0,1])
    ans = -(10**18)
    for item in list1:
        for item2 in list2:
            ans = max(ans,item*item2)
    print(ans)     


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
r=input().split()
a=int(r[0])
b=int(r[1])
c=int(r[2])
d=int(r[3])
x=b*d
y=a*c
z=a*d
w=b*c
print(max(x,y,z,w))

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

Submission status: Accepted

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

max_num = 0

max_num = num[0] * num[2]

max_num = max(max_num, num[0] * num[3])

max_num = max(max_num, num[1] * num[2])

max_num = max(max_num, num[1] * num[3])

print(max_num)

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:
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

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:
# coding:utf-8
a, b, c, d = map(int, input().split())
num = [a * c, a * d, b * c, b * d]
print(max(num))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = list(map(int, input().split()))
s1 = s[0]*s[2]
s2 = s[0]*s[3]
s3 = s[1]*s[2]
s4 = s[1]*s[3]
print(max(s1,s2,s3,s4))

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:
abcd=input().split()
a=int(abcd[0])
b=int(abcd[1])
c=int(abcd[2])
d=int(abcd[3])
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:
# -*- coding: utf-8 -*-

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    a, b, c, d = list(map(int, input().split()))

    return a, b, c, d


def main(a: int, b: int, c: int, d: int) -> None:
    """
    メイン処理.

    Args:\n
        a (int): 整数(-10**9 <= a <= b <= 10**9)
        b (int): 整数(-10**9 <= a <= b <= 10**9)
        c (int): 整数(-10**9 <= c <= d <= 10**9)
        d (int): 整数(-10**9 <= c <= d <= 10**9)
    """
    # 求解処理
    ans = max([a * c, a * d, b * c, b * d])

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    a, b, c, d = get_input()

    # メイン処理
    main(a, b, c, d)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
tmp = [int(e) for e in input().split()]

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

res = a * c

tmp = a * d

if tmp > res:
    res = tmp

tmp = b * c

if tmp > res:
    res = tmp

tmp = b * d

if tmp > res:
    res = tmp

print(res)

Submission status: Accepted

Solution code:
(X1,X2,Y1,Y2)=list(map(int,input().split()))
ans=max(X2*Y2,X1*Y1,X1*Y2,X2*Y1)
print (ans)

Submission status: Accepted

Solution code:
(X1,X2,Y1,Y2)=list(map(int,input().split()))
ans=X2*Y2
ans=max(ans,X1*Y1)
ans=max(ans,X1*Y2)
ans=max(ans,X2*Y1)
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())
xy = [a*c,a*d,b*c,b*d]
print(max(xy))

Submission status: Accepted

Solution code:
import numpy as np

a, b, c, d = map(int, input().split())
x = np.array([a, b])
y = np.array([c, d])
z = np.outer(x, y)
print(z.max())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
inputs = [int(d) for d in input().split()]

results = []
for i in (0, 1):
  for j in (2, 3):
    results.append(inputs[i] * inputs[j])

print(max(results))

Submission status: Accepted

Solution code:
##B - Product Max
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(a*c,a*d,b*c,b*d))

Submission status: Accepted

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

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

ac=abcd[0]*abcd[2]
ad=abcd[0]*abcd[3]
bc=abcd[1]*abcd[2]
bd=abcd[1]*abcd[3]

maxnum=ac

if maxnum<ad:
    maxnum=ad
if maxnum<bc:
    maxnum=bc
if maxnum<bd:
    maxnum=bd

print(maxnum)

Submission status: Accepted

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

a, b, c, d = read()

p = a * c
q = a * d
r = b * c
s = b * d
print(max(p, q, r, s))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(max(l))

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())
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()]
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(max(a*c,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:
#!/usr/bin python3
# -*- coding: utf-8 -*-

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() )
#print( a, b, c, d )

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

ans1 = max( ac, bd )
ans2 = max( ad, bc )

ans = max( ans1, ans2 )
print( ans )

Submission status: Accepted

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

a,b,c,d = gets_ints()

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,a*d,b*c,b*d]))

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    A, B, C, D = map(int, input().split())
    ans = -10**9**2

    for ab in (A, B):
        for cd in (C, D):
            if ab * cd > ans:
                ans = ab * cd

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print (max(min))

Submission status: Accepted

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])
m=[]
m.append(a*c)
m.append(a*d)
m.append(b*c)
m.append(b*d)
print(max(m))

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split(' '))
if a>=0:
  if d<=0:
    ans=a*d
  else:
  	x=b
  	y=d
  	ans=b*d
elif a<=0 and b>=0:
  if c>=0:
    x=b
    y=d
    ans=b*d
  elif c<=0 and d>=0:
      ans=max(a*c,b*d)
  else:
    ans=a*c
else:
  if c>=0:
    ans=b*c
  else:
    ans=a*c
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 = (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())
x = a * c
y = a * d
z = b * c
u = b * d
ans = max(x, y, z, u)
print(ans)

Submission status: Accepted

Solution code:
#n = int(input())
a, b, c, d = map(int, input().split())
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

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())
print(max(b*d,a*c,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())
print(max(A*C,A*D,B*C,B*D))

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
x=[]*4
x.append(a*c)
x.append(b*c)
x.append(a*d)
x.append(b*d)
x.sort()
print(x[-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:UTF-8
import sys

if __name__ == '__main__':
    # ------ 入力 ------#
    # 1行入力
    # a = int(input())    # 数字
    # a = input()     # 文字列
    aList = list(map(int, input().split()))     # スペース区切り連続数字
    # a = input().split()     # スペース区切り連続文字列
    # a = [int(c) for c in input()]   # 数字→単数字リスト変換

    # 定数行入力
    x = 5
    # a = [int(input()) for _ in range(x)] # 数字
    # a = [input() for _ in range(x)] # 文字
    # a = [list(map(int, input().split())) for _ in range(x)]     # スペース区切り連続数字(行列)
    # a = [input().split() for _ in range(x)]     # スペース区切り連続文字
    # a = [[int(c) for c in input()] for _ in range(x)]  # 数字→単数字リスト変換(行列)

    # スペース区切り連続 数字、文字列複合
    # a = []
    # for _ in range(x):
    #     aa, bb = input().split()
    #     a.append((int(aa), bb))

    # ------ 処理 ------#
    a = aList[0]
    b = aList[1]
    c = aList[2]
    d = aList[3]
    m = max(a*c, a*d, b*c, b*d)

    # ------ 出力 ------#
    print("{}".format(m))

Submission status: Accepted

Solution code:
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))


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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
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())
max_list = [a*c,a*d,b*c,b*d]
max_list = sorted(max_list, reverse=True)
print(max_list[0])

Submission status: Accepted

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

Submission status: Accepted

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

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

print(max(li))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8
a,b,c,d= map(int,input().split())
print(max(max(a*c,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())
list_multi = []
list_multi.append(a * c)
list_multi.append(a * d)
list_multi.append(b * c)
list_multi.append(b * d)
print(max(list_multi))

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

ans = []
for x in range(2):
	for y in range(2,4):
		ans.append(nums[x]*nums[y])	 
print(max(ans))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
L = [a*c, a*d, b*c, b*d]
ans = max(L)
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:
from sys import stdin


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    a, b, c, d = list(map(int, _in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    ans = -float('inf')
    for _ in [a * c, a * d, b * c, b * d]:
        ans = max(ans, _)
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

val1 = a*c
val2 = a*d
val3 = b*c
val4 = b*d
print(max(val1,val2,val3,val4))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
if a <= 0 and b >= 0:
    print(max(a*c, a*d, b*c, b*d, 0))
elif c <= 0 and d >= 0:
    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:
def main():
    lis = list(map(int, input().split()))
    ans = lis[0] * lis[2]
    a, b = lis[0:2], lis[2:4]
    for i in a:
        for j in b:
            if i * j > ans:
                ans = i * j
                
    print(ans)
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = -10**18+1
for i in [a,b]:
  for j in [c,d]:
    if ans < i*j: ans = i*j
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(max(x))

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

Submission status: Accepted

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

Submission status: Accepted

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

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  a,b,c,d=map(int,pin().split())
  print(max(a*c,a*d,b*c,b*d))
  return
main()

Submission status: Accepted

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

x_li = [a, b]
y_li = [c, d]

my_list = []

for x in x_li:
    for y in y_li:
        my_list.append(x * y)
        
print(max(my_list))

Submission status: Accepted

Solution code:
l =  list(map(int, input().split()))
r = []
for i in range(0, 2, 1):
  for j in range(2, 4, 1):
    r.append(l[i] * l[j])

print(max(r))

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

Submission status: Accepted

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

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

a, b, c, d = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
#ABC = [list(map(int, input().split())) for _ in range(N)]
#S = input()
#S = [input() for _ in range(N)]

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] = [int(inp) for inp in input().split()]
print(max([a * c, b * d, a * d, b * c]))

Submission status: Accepted

Solution code:
import sys
INF = float('inf')
a,b,c,d = map(int, sys.stdin.readline().rstrip("\n").split())
l = [a,b]
r = [c,d]
ans = -INF
for ln in l:
    for rn in r:
        ans = max(ans,ln*rn)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import itertools

a,b,c,d = map(int, input().split())
ab = [a,b]
cd = [c,d]

ans = - float('inf')
for x, y in itertools.product(ab,cd):
  ans = max(ans, x*y)
  
print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
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:
import itertools

a,b,c,d = map(int, input().split())
ab = [a,b]
cd = [c,d]

if a<=0 and 0<=b:ab.append(0)
if c<=0 and 0<=d:cd.append(0)

ans = - float('inf')
for x, y in itertools.product(ab,cd):
  ans = max(ans, x*y)
  
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

res = a * c
for x in [a, b]:
    for y in [c, d]:
        res = max(res, x * y)

print(res)

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 = 10**20 * -1
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, 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())
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())
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,a*d,b*c,b*d))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B - Product Max
def main():
    A, B, C, D = map(int, input().split())
    res = max(A * C, A * D, B * C, B * D)
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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:
# @uthor : Kaleab Asfaw
from sys import stdin, stdout
# Fast IO
# from math import gcd

def input():
	a = stdin.readline()
	if a[-1] == "\n": a = a[:-1]
	return a
def print(*argv, end="\n", sep=" "):
	n = len(argv)
	for i in range(n):
		if i == n-1: stdout.write(str(argv[i]))
		else: stdout.write(str(argv[i]) + sep)
	stdout.write(end)
# Others
mod = 10**9+7
def lcm(x, y): return (x * y) / (gcd(x, y))
def fact(x, mod=mod):
	ans = 1
	for i in range(1, x+1): ans = (ans * i) % mod
	return ans
def arr2D(n, m, default=0):
	lst = []
	for i in range(n): temp = [default] * m; lst.append(temp)
	return lst
def sortDictV(x): return {k: v for k, v in sorted(x.items(), key = lambda item : item[1])}

def solve(a, b, c, d):
	return max([a*c, a*d, b*c, b*d])

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

Submission status: Accepted

Solution code:
import sys,math
try:sys.stdin,sys.stdout=open('input.txt','r'),open('out.txt','w')
except:pass
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt,log
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
# print('{:.3f}'.format(1),round(1.123456789,4))
# sys.setrecursionlimit(500000)
def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(s, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if s[mid] == val:return mid
        elif s[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,s):
    for i in range(1,n):s[i]+=s[i-1]
    return s;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;
# code here

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

Submission status: Accepted

Solution code:
from itertools import product
a, b, c, d = map(int, input().split())
print(max(v[0] * v[1] for v in product((a, b), (c, d))))