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:
#!/usr/bin/env python3

'''
Author: andyli
Time: 2020-09-13 19:58:04
'''

import os
from io import BytesIO, IOBase
import sys


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

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


# region fastio
BUFSIZE = 1048576


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = 'x' in file.mode or 'r' not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b'\n') + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode('ascii'))
        self.read = lambda: self.buffer.read().decode('ascii')
        self.readline = lambda: self.buffer.readline().decode('ascii')


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip('\r\n')

# endregion


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, combinations, chain, product
from functools import lru_cache
from collections import deque, defaultdict
from operator import itemgetter
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

from pprint import pprint

def main():
    import itertools
    a, b, c, d = mis()
    print(max(x*y for x, y in itertools.product((a, b), (c, d))))




main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

X_cand=[A,B]
if A<=0<=B:
    X_cand.append(0)

Y_cand=[C,D]
if C<=0<=D:
    Y_cand.append(0)

ans=-float("inf")

for x in X_cand:
    for y in Y_cand:
        ans=max(ans,x*y)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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
input=sys.stdin.readline

def main():
    a, b, c, d = map(int, input().split())
    print(max(max(max(a * c, b * d), a * d), b * c))
    
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    a, b, c, d = [int(x) for x in input().strip().split()]
    print(max(a*c, a*d, b*c, b*d))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

A1 = a * c
A2 = a * d
A3 = b * c
A4 = b * d

print(max(A1,A2,A3,A4))

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


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


print(solve())

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

Submission status: Accepted

Solution code:
def main():
    examB()

def examA():
    N = I()
    ans = 1^N
    print(ans)
    return

def examB():
    a, b, c, d = LI()
    ans = max(a*c,a*d,b*c,b*d)
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,alphabet_convert,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 1<<31
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    main()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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:
# import numpy as np
import sys, math, heapq
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep="\n")

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

res = -float("inf")
for x in [a, b]:
    for y in [c, d]:
        val = x * y
        res = max(res, val)

print(res)

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:
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
#import math
#import numpy as np
#= int(input())
#= input()
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(max(a*c, b*d, a*d, c*b))

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

main()

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def _ia(): return map(int, sys.stdin.readline().strip().split())


def main():
    a, b, c, d = _ia()
    return max(a*c, a*d, b*c, b*d)


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a,b,c,d = m()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
a,b,c,d = readInts()
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 = [int(n) for n in input().split()]

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

Submission status: Accepted

Solution code:
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
mod = 10 ** 9 + 7; INF = float("inf")

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

def inverse(N, mod):
	return (pow(N, mod - 2, mod))

def main():
	a, b, c, d = getlist()
	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())
print(max(
    a*c,
    a*d,
    b*c,
    b*d
))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    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())
print(max([a*c, a*d, b*c, b*d]))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# x = int(input())

# print(1) if x == 0 else print(0)

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

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

print(max(ans))

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

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

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
def main():

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

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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(x * y for x in [A, B] for y in [C, D]))

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')
AZ = "abcdefghijklmnopqrstuvwxyz"

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


#####Shorten#####
def DD(arg): return defaultdict(arg)

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b: a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

a,b,c,d = IL()

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = 10**6#float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


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

Submission status: Accepted

Solution code:
import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def solve():
    a, b, c, d = getList()
    print(max(a* c, a*d, b *c, b*d))

def main():
    n = getN()
    for _ in range(n):
        solve()

    return
if __name__ == "__main__":
    # main()
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, 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())
a1 = a*c
a2 = a*d
a3 = b*c
a4 = b*d
print(max(a1,a2,a3,a4))