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


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    a, b, c, d = input_to_int_map()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

lista.sort(reverse=True)

print(lista[0])

Submission status: Accepted

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


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


print(max(outl))

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:
import sys
import math
from collections import Counter
from collections import OrderedDict
def inputt():
    return sys.stdin.readline().strip()
def printt(n):
    sys.stdout.write(str(n)+'\n')
def listt():
    return [int(i) for i in inputt().split()]

def gcd(a,b): 
   return math.gcd(a,b) 
 
def lcm(a,b): 
    return (a*b) / gcd(a,b) 

def dfs(src, visit):
    count=1
    visit[src] = 1
    for nbr in dic[src]:
        if nbr==-1:
            continue
        if visit[nbr] == 0:
            count+=dfs(nbr, visit)   
    return count          


a,b,c,d=map(int,inputt().split())
l=[]
l.append(b*d)
l.append(a*d)
l.append(a*c)
l.append(b*c)
print(max(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a < 0 and 0 <= b:
    if c < 0 and 0 <= d:
        answer = max(a * c, b * d)
    elif 0 <= c and 0 <= d:
        answer = b * d 
    elif c < 0 and d < 0:
        answer = a * c

elif 0 <= a and 0 <= b:
    if c < 0 and 0 <= d:
        answer = b * d
    elif 0 <= c and 0 <= d:
        answer = b * d
    elif c < 0 and d < 0:
        answer = a * d

elif a < 0 and b < 0:
    if c < 0 and 0 <= d:
        answer = a * c
    elif 0 <= c and 0 <= d:
        answer = b * c
    elif c < 0 and d < 0:
        answer = a * c

print(answer)

Submission status: Accepted

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

if(a > 0 and b > 0):
    if(c <= 0 and d <= 0):
        print(a * d)
        exit()
if(c > 0 and d > 0):
    if(a <= 0 and b <= 0):
        print(c * b)
        exit()

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

Submission status: Accepted

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

ans = a * c
for x in [a,b]:
    for y in [c,d]:
        if ans <= x * y:
            ans = x * y

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

Max=max([a*c,a*d,b*c,b*d])
if (a<=0 and b>=0) or (c<=0 and d>=0):
    Max=max(Max,0)
print(Max)

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
a, b, c, d= map(int, input().split())
print(max(a*c,a*d,b*c,b*d))

Submission status: Accepted

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

Submission status: Accepted

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

ans = max([x*y for x in [a, b] for y in [c, 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:
a,b,c,d=map(int,input().split())
if a*b<=0 or c*d<=0:ans=0
else:ans=-float('inf')
for i in [a,b]:
    for j in [c,d]:ans=max(ans,i*j)
print(ans)

Submission status: Accepted

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

l = []
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

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

a,b,c,d = inm()

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

print(max(mul))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
ans=-1000000000000000000
for i in range(2):
    for j in range(2):
        sum=a[i]*a[j+2]
        ans=max(sum,ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    a,b,c,d = i_map()

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

    print(max(ans))






if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if a >= 0 and c >=0:
    print(b*d)
elif b <= 0 and d <= 0:
    print(a*c)
elif a >= 0 and d <= 0:
    print(a*d)
elif b <= 0 and c >= 0:
    print(b*c)
else:
    if a*c > b*d:
        print(a*c)
    else:
        print(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 = [a,b]
y = [c,d]
ans = []
for xi in x:
    for yi in y:
        tmp = xi*yi
        ans.append(tmp)
ans = max(ans)
print(ans)

Submission status: Accepted

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

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

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

if b < 0 and d < 0: #両方負
    print(a*c)
elif b < 0: #xは負
    if c < 0:
        print(a*c) #負*負
    else:
        print(b*c)
elif d < 0: #yは負
    if a < 0:
        print(a*c) #負*負
    else:
        print(a*d)
else:
    print(max(a*c, b*d))

Submission status: Accepted

Solution code:
a, b, c, d = list(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())

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



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

Submission status: Accepted

Solution code:
import sys

input_ = sys.stdin.readline

a, b, c, d = [int(x) for x in input_().strip().split(" ")]

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 178
# 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 = tuple(map(int, input().split()))

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

print(ans)

Submission status: Accepted

Solution code:
a, b , c ,d = map(int,input().split(' '))
one = a*c
two = a*d
three = b*c
four = b*d
line = [one, two, three, four]
print(max(line))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b,c,d =map(int,input().split())
from itertools import product
li=[]
for nu in product([a,b],[c,d]):
  num=nu[0]*nu[1]
  li.append(num)

print(max(li))

Submission status: Accepted

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

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

ans_list = [ad,ac,bd,bc]

print(max(ans_list))

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

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

print(max(l))

Submission status: Accepted

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

ans = -1000000000000000001
tmp = 0
tmp = a*c
if ans < tmp:
    ans = tmp
tmp = a*d
if ans < tmp:
    ans = tmp
tmp = b*d
if ans < tmp:
    ans = tmp

tmp = b*c
if ans < tmp:
    ans = tmp
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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = list(map(int, input().split()))
    max_ = -1e18
    for x in a[0:2]:
        for y in a[2:4]:
            if x * y > max_:
                max_ = x * y
    print(max_)

Submission status: Accepted

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

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

if max(hoge) < 0:
  if np.sign(a) != np.sign(b) or np.sign(c) != np.sign(d):
    print(0)
  else:
    print(max(hoge))
else:
  print(max(hoge))

Submission status: Accepted

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

Submission status: Accepted

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


A=int(S[0])*int(S[2])
B=int(S[0])*int(S[3])
C=int(S[1])*int(S[2])
D=int(S[1])*int(S[3])

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

Submission status: Accepted

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

Submission status: Accepted

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

print(max(x))

Submission status: Accepted

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

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

lst1 = [a*c, a*d, b*c, b*d]
lst1.sort(reverse=True)

print(lst1[0])

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

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

print(max(list_xy))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
a,b,c,d=map(int,input().split())
ans=max(a*c,b*d,b*c,a*d)
print(ans)

Submission status: Accepted

Solution code:
a,b,c,d = list(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 = 0
x = a*c
y = a*d
z = b*c
w = b*d
print(max(x,y,z,w))

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

Submission status: Accepted

Solution code:
#
# abc178 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """1 2 1 1"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3 5 -4 -2"""
        output = """-6"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """-1000000000 0 -1000000000 0"""
        output = """1000000000000000000"""
        self.assertIO(input, output)


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

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# B
a, b, c, d = map(int,input().split())
kot = []
kot.append(a * c)
kot.append(a * d)
kot.append(b * c)
kot.append(b * d)
kot = sorted(kot,reverse=True)
print(kot[0])

Submission status: Accepted

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

Submission status: Accepted

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

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

print(max(ans_lis))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(ans)

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

Submission status: Accepted

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

ma=-10000000000000000000000000000000
for i in range(4):
    if ma<k[i]:
        ma=k[i]

print(ma)

Submission status: Accepted

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

Submission status: Accepted

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

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

L.sort(reverse = True)
print(L[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    a, b, c, d = map(int, input().split())
    ans = 0
    o = a*c
    p = a*d
    q = b*c
    r = b*d
    ans = max(o, p,q, r)
    print(ans)

        



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(max(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d = map(int, input().split())
t = list()
ac = a*c
bc = b*c
ad = a*d
bd = b*d
t.append(ac)
t.append(bc)
t.append(ad)
t.append(bd)
ans = -1 * 10**18
for i in range(4):
  ans = max(t[i],ans)
print(ans)

Submission status: Accepted

Solution code:
#coding: UTF-8
a, b, c, d = map(int,input().split())
tmp = a*c
if tmp < a*d:
  tmp = a*d
if tmp < b*c:
  tmp = b*c
if tmp < b*d:
  tmp = b*d
print(tmp)

Submission status: Accepted

Solution code:
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)
a,b,c,d=map(int, input().split())
#print(min(a,b)*min(d,c),max(a,b)*max(c,d))
print(max(min(a,b)*max(d,c),max(a,b)*min(c,d),min(a,b)*min(d,c),max(a,b)*max(d,c)))

Submission status: Accepted

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

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

if AC > AD and AC > BC and AC > BD:
    print(AC)
elif AD > BC and AD > BD:
    print(AD)
elif BC > BD:
    print(BC)
else:
    print(BD)

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

print(max(ans))

Submission status: Accepted

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

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

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

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:
def main():

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

    ans = a * c
    ans2 = a * d
    ans3 = b * c
    ans4 = b * d
    
    if ans2 > ans:
        ans = ans2
    
    if ans3 > ans:
        ans = ans3

    if ans4 > ans:
        ans = ans4

    print(ans)

main()

Submission status: Accepted

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

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

print(max(lst))

Submission status: Accepted

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

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

elif c<0 and a>=0:
  if d>=0:
    print(b*d)
  else:
    print(d*a)    
else:
  if b<0 or d<0:
    print(a*c)
  else:
    if a*c<=b*d:
      print(b*d)
    else:
      print(a*c)

Submission status: Accepted

Solution code:
def main():
    a,b,c,d = map(int,input().split())
    
    ans = -1 * 10**20
    
    if a*b <= 0:
        ans = 0
    if c*d <= 0:
        ans = 0
    
    for i in (a,b):
        for j in (c,d):
            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())
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())
result = -1000000000000000000
ac = a * c
if result < ac:
    result = ac
ad = a * d
if result < ad:
    result = ad
bc = b * c
if result < bc:
    result = bc
bd = b * d
if result < bd:
    result = bd
print(result)

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

ans = []

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

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

print(max(ans))

Submission status: Accepted

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

ab = a*c
ad = a*d
bc = b*c
bd = b*d
print(max(ab,ad,bc,bd))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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(i) for i in 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=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*d,b*c,a*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:
myinput = list(map(int,input().split()))

firstarg = myinput[0:2]
secondarg = myinput[2:4]

#print(firstarg,secondarg)

resultlist = [0]*4

for i in range(2):
    for j in range(2):
        resultlist[2*i+j]=firstarg[i]*secondarg[j]

#print(resultlist)
print(max(resultlist))

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split(' ')]
a = n[0]
b = n[1]
c = n[2]
d = n[3]
ans_list = []
ans_list.append(a*c)
ans_list.append(a*d)
ans_list.append(b*c)
ans_list.append(b*d)
print(max(ans_list))

Submission status: Accepted

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


def solve(a: int, b: int, c: int, d: int):
    ans1=a*c
    ans2=a*d
    ans3=b*c
    ans4=b*d
    print(max(ans1,ans2,ans3,ans4))
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    solve(a, b, c, d)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans_num = -10000000000000000001

if lis[0] * lis[2] >= ans_num:
    ans_num = lis[0] * lis[2]
if lis[0] * lis[3] >= ans_num:
    ans_num = lis[0] * lis[3]
if lis[1] * lis[2] >= ans_num:
    ans_num = lis[1] * lis[2]
if lis[1] * lis[3] >= ans_num:
    ans_num = lis[1] * lis[3]

print(ans_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:
a,b,c,d = map(int,input().split())
if a == 0 and a!=b:
    a += 1
if b == 0 and a!=b:
    b -= 1
if c == 0 and c!=d:
    c += 1
if d == 0 and c!=d:
    d -= 1
num1 = a*c
num2 = a*d
num3 = b*c
num4 = b*d
print(max(num1,num2,num3,num4))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = list(map(int, input().split()))
max = a * c
for i, j in ((a, d), (b, c), (b, d)):
    p = i * j
    if p > max:
        max = p

print(max)

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# from time import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

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

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(max(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    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)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

print(x)

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
print(max(x1,x2,x3,x4))

Submission status: Accepted

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

x_list = [a, b]
y_list = [c, d]

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

ans_list.sort()
ans = ans_list[-1]
print(ans)

Submission status: Accepted

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

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


print(max(M))

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

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

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())
m=a*c
n=a*d
o=b*c
p=b*d
kotae=max([m,n,o,p])
print(kotae)

Submission status: Accepted

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

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

print(max(candidate))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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