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:
# Date [ 2020-09-13 21:00:56 ]
# Problem [ b.py ]
# Author Koki_tkg

import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def Main():
    a, b, c, d = read_ints()
    ans = -10 ** 18
    for x in [a, b]:
        for y in [c, d]:
            ans = max(ans, x*y)
    print(ans)

if __name__ == '__main__':
    Main()

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

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

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

Submission status: Accepted

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

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:
import itertools

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

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

m = int(-1e20)
for x, y in itertools.product(l, r):
    m = max(m, x*y)

print(m)

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


def solve(a: int, b: int, c: int, d: int):
    ans = -float("inf")
    if a <= 0 <= b or c <= 0 <= d:
        ans = 0
    for x in [a, b]:
        for y in [c, d]:
            ans = max(ans, x*y)
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(a, b, c, d))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

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

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

Submission status: Accepted

Solution code:

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

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

a, b, c, d = map(int, input().strip().split())
res = a * c
res2 = b * d
res3 = a * d
res4 = b * c
if res < res2:
    res = res2
if res < res3:
    res = res3
if res < res4:
    res = res4
print(res)

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:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    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


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
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)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

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

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

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

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

# a <= x <= b, c <= y <= d

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

print(max(A))

Submission status: Accepted

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

Submission status: Accepted

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

flg = 0
rslt = -10000000000000000000000000
for x in [A[0],A[1]]:
    for y in [A[2],A[3]]:
        flg = x*y
        
        rslt = max(rslt,flg)
        
        

print(rslt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import math
import re
import numpy as np
import copy

#読み込む
S = input().split(' ')

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

ls = []

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

ans = max(ls)

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

AC = a * c
AD = a * d
BC = b * c
BD = b * d

print(max(AC,AD,BC,BD))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    a, b, c, d = map(int, input().split())

    ans = -10 ** 20
    for x in [a, b]:
        for y in [c, d]:
            ans = max(ans, x * y)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

ans=max(ans1)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c, d = [int(s) for s in input().split(" ")]
ans1 = a * c
ans2 = b * d
ans3 = a * d
ans4 = b * c
print("%d" % max([ans1, ans2, ans3, ans4]))

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

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

print(max(check))

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

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

a, b, c, d = getNM()
x = [a, b]
y = [c, d]

ans = []
for i in range(2):
    for j in range(2):
        ans.append(x[i] * y[j])

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

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

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

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:
# coding: utf-8
# Your code here!
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())


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


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


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

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

Submission status: Accepted

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################


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







'''
# Wrap solution for more recursion depth
#submit as python3
import collections,sys,threading
sys.setrecursionlimit(10**9)
threading.stack_size(10**8)



threading.Thread(target=solve).start()
'''

Submission status: Accepted

Solution code:
# abc178_b.py
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
input = sys.stdin.readline

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

ab = [a, b]
cd = [c, d]

ans = a*c

for i in ab:
  for j in cd:
    if i*j > ans:
      ans = i* j

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


ans1 = a * d
ans2 = a * c
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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d = map(int,input().split())
l = [a,b]
k = [c,d]
maxi = -10**18
for i in l:
    for j in k:
        maxi = max(maxi,i*j)
print(maxi)

Submission status: Accepted

Solution code:
from sys import exit, stdin

input = stdin.readline
import copy

# from collections import deque,Counter
# import numpy as np
a, b, c, d = list(map(int, input().split()))


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

print(ans)

Submission status: Accepted

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

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

l = []
l.append(A)
l.append(B)
l.append(C)
l.append(D)

print(max(l))

Submission status: Accepted

Solution code:
import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
a,b,c,d=I()
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
ad = a*d
bc = b*c
bd = b*d
ans = max(ac, ad)
ans = max(ans, bc)
ans = max(ans, bd)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    b = [a[0]*a[2],a[0]*a[3],a[1]*a[2],a[1]*a[3] ]
    if ((a[0]<=0 ) and ( 0<=a[1] )  ) or ((a[2] <=0) and (0<=a[3])):
        b.append(0)
    print(max(b))

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

x_cands = [a, b]
if a <= 0 <= b:
	x_cands.append(0)
y_cands = [c, d]
if c <= 0 <= d:
	y_cands.append(0)

values = []
for x in x_cands:
	for y in y_cands:
		values.append(x * y)

print(max(values))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math as mt
import sys
import bisect
input=sys.stdin.readline
#t=int(input())
t=1
mod=10**9+7
for _ in range(t):
    
    #n=int(input())
    a,b,c,d=map(int,input().split())
    #u1,d1=map(int,input().split())
    #u2,d2=map(int,input().split())
    #l=list(map(int,input().split()))
    
    print(max(b*d,b*c,a*c,a*d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

print("{}".format(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

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

    print(res)



main()

Submission status: Accepted

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline

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

    ans = -float("inf")
    for x in [a, b]:
        for y in [c, d]:
            tmp = x * y
            if ans < tmp:
                ans = tmp

    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 21:02:10 2020

@author: liang
"""

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

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]


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

    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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:
# coding: utf-8
# Your code here!
a=list(map(int,input().split()))
s=[a[0],a[1]]
t=[a[2],a[3]]
ans=a[0]*a[2]
for i in s:
    for j in t:
        if ans<i*j:
            ans=i*j
print(ans)

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
x = [a,b]
y = [c,d]
ans = -1*10**20
for i in x:
    for j in y:
        ans = max(ans, i*j)
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a, b ,c, d = list(map(int, input().split()))
ans = -10 ** 18
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:
# import math
# import statistics
# a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
e1,e2,e3,e4 = map(int,input().split())
#f = list(map(int,input().split()))
# g = [input() for _ in range(a)]

a=e1*e3
b=e1*e4
c=e2*e3
d=e2*e4
print(max(a,b,c,d))

Submission status: Accepted

Solution code:
from __future__ import division, print_function
import bisect
import math
import heapq
import itertools
import sys
from collections import deque
from atexit import register
from collections import Counter
from functools import reduce
if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream
 
 
if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)
 
        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)
 
        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)
 
    input = raw_input
    range = xrange
 
    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip
 
 
def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.
 
    Args:
        sync (bool, optional): The new synchronization setting.
 
    """
    global input, flush
 
    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')
 
        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    # sys.stdin  = open("input.txt")
    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))
    

if __name__ == '__main__':
    sync_with_stdio(False)
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict, deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

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

Submission status: Accepted

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

print(max(lista))

Submission status: Accepted

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

Submission status: Accepted

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

ans_candi = []

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

print(max(ans_candi))

Submission status: Accepted

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

max_a = max(a*c,a*d)
max_b = max(b*c,b*d)
print(max(max_a,max_b))

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=tf-8
#

"""
"""

from collections import defaultdict
import bisect

import sys
input = sys.stdin.readline

def solve(a,b,c,d):
    anss = [a*c,a*d,b*c,b*d]
    print(max(anss))

            

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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 math
import collections
import itertools

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

resolve()

Submission status: Accepted

Solution code:

def main():
    # n = int(input())
    a, b, c, d = map(int, input().split())
    # l = list(map(int, input().split()))
    # s = input()

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = [-10 ** 9] * 4
ans[0] = a * c
ans[1] = a * d
ans[2] = b * c
ans[3] = b * d

print(max(ans))

Submission status: Accepted

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

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

m = a * c
for x in (a, b):
    for y in (c, d):
        m = max(m, x * y)
print(m)

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

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

ans = -(10 ** 18)
for x in [a, b]:
    for y in [c, d]:
        ans = max(ans, x*y)
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def SL(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [SL() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]

def perm(n, r): return math.factorial(n) // math.factorial(r)
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))

def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if len(args) > 0 else [default for _ in range(n)]

dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
MOD = 1000000007
INF = float("inf")

sys.setrecursionlimit(1000000)

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
# maze = [list(input()) for _ in range(H)]
# a = list(map(int, input().split()))

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

print(ans)

Submission status: Accepted

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

    mx = -float('inf')
    for l in lower:
        for u in upper:
            mx = max(mx, l*u)
    
    print(mx)
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

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