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

def maxp():
  xy=[a*c,a*d,b*c,b*d]
  return max(xy)

print(maxp())

Submission status: Accepted

Solution code:
a,b,c,d = [int(a) for a in input().split()]
A = a * c
B = a * d
C = b * c
D = b * d
print(max(list([A,B,C,D])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
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(' '))
result = [a * c, a * d, b * c, b * d]
result.sort()
print(result[-1])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


arr = list(map(int, input().split()))
ans = []
ans.append(arr[0]*arr[2])
ans.append(arr[0]*arr[3])
ans.append(arr[1]*arr[2])
ans.append(arr[1]*arr[3])


print(max(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
if a<=0 and b>=0:
    xlist = [a,0,b]
else:
    xlist = [a,b]
if c<=0 and d>=0:
    ylist = [c,0,d]
else:
    ylist = [c,d]

ans = -1001001001001001001
for x in xlist:
    for y in ylist:
        ans = max(ans, x*y)
print(ans)

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    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(int(max(A)))
   




if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

print(max(nums))

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (a, b, c, d) = [int(e) for e in lines[0].split(" ")]

    return (a, b, c, d)


def solve(a, b, c, d):

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

    return result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
import math
def solve():
	arr = [int(x) for x in input().split()]
	a = arr[0]
	b = arr[1]
	c = arr[2]
	d = arr[3]
	arr2 = [a*c,a*d,b*c,b*d];
	print(max(arr2));

solve()

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
a,b,c,d = map(int,input().split())

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

num_list = []

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

print(max(num_list))

Submission status: Accepted

Solution code:
def main():
    a, b, c, d  = map(int, input().split())
    #A_list = list(map(int, input().split()))
    l = a * c
    m = a * d
    n = b * c
    o = b * d
    ans = max(l,m,n,o)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b,c,d=[int(x) for x in input().split()]
mn1=a
mx1=b
mn2=c
mx2=d
prod=a*c
prod=max(prod,b*d)
prod=max(prod,a*d)
prod=max(prod,b*c)
if(a<=0 and b>=0):
    prod=max(prod,0)
if(c<=0 and d>=0):
    prod=max(prod,0)
print(prod)

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**9 + 7
EPS = 10**-10

a, b, c, d = MAP()

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

Submission status: Accepted

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

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

print(ans)

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

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

Submission status: Accepted

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

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

product = a * c

if (product < a * d):
    product = a * d
if (product < b * c):
    product = b * c
if (product < b * d):
    product = b * d

print(product)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(z)

Submission status: Accepted

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

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

print(max(A))

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:
i1=lambda : input()
i2=lambda : int(input())
i3=lambda : map(int,input().split())
i4=lambda n : [list(map(int,input().split()) for _ in range(n))]

A,B,C,D=i3()

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

print(max(A))

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

max = a*c
if a*d > max:
    max = a*d
if b*c > max:
    max = b*c
if b*d > max:
    max = b*d
print(max)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
import math
from itertools import accumulate
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def floor(a, b): return -(-a // b)


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


def z(): return int(sys.stdin.readline())


def S(): return sys.stdin.readline()[:-1]


def C(line): return [sys.stdin.readline() for _ in range(line)]


a, b, c, d = zz()
# 正負の場合
a1 = a * c
a2 = a * d
a3 = b * c
a4 = b * d
if (a <= 0 <= b):
    a5 = 0
else:
    a5 = a4
if (c <= 0 <= d):
    a6 = 0
else:
    a6 = a4
print(max(a1, a2, a3, a4, a5, a6))

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

Submission status: Accepted

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

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

print(max(prod))

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    a, b, c, d = map(int, args[0].split())

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


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

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

Submission status: Accepted

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

M = -(10 ** 20)

for i in range(2):
    for j in range(2, 4):
        m = l[i] * l[j]
        if M < m:
            M = m

print(M)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import itertools

a, b, c, d = map(int, input().split())
print(max(x*y for x, y in itertools.product([a, b], [c, d])))

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

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

print(max(list))

Submission status: Accepted

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

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

print(max(data))

Submission status: Accepted

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

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

a, b, c, d = list(map(int, input().split()))
if (a <= 0 and b >= 0) or (c<=0 and d>=0):
    zero = True
else:
    zero = False

if zero:
    print(max(a*c, a*d, b*c, b*d, 0))
else:
    print(max(a * c, a * d, b * c, b * d))

Submission status: Accepted

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

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

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:
import sys
r=sys.stdin.readline
a,b,c,d=map(int,r().split())
print(max([a*c,a*d,b*c,b*d]))

Submission status: Accepted

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

ans = 10**100
ans = ans * -1    

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(max(ans))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
a1 = a*c
a2 = b*d
a3 = a*d
a4 = b*c

print(max(a1,a2,a3,a4))

Submission status: Accepted

Solution code:
#ABC178-b
import sys,math,collections,itertools
input = sys.stdin.readline

a,b,c,d=list(map(int,input().split()))
A = [a,b]
C = [c,d]
ans = -1*float('inf')
for ta in A:
    for tc in C:
        ans = max(ta*tc,ans)
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    A, B, C, D = map(int, input().split())
    ans = max(A * C, A * D, B * C, B * D)
    print(ans)


main()

Submission status: Accepted

Solution code:

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

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

def input_int_map():
    return(map(int,input().split()))

def run():
    a, b, c, d = input_int_map()

    reuslt = max(a * c, a * d, b * c, b * d)
    print(reuslt)
run()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from collections import deque
#from math import gcd
#MOD = 10**9 + 7
#N = int(input())
a, b, c, d= map(int, input().split())
#A = list(map(int, input().split()))
#ans = 0
#print(ans)

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

Submission status: Accepted

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

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:
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

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

a,b,c,d = readInts()

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b, c, d = map(int, input().split())
print(max([a * c, a * d, b * c, b * d]))

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

Submission status: Accepted

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

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

print(max_value)

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import math,sys

a,b,c,d = map(int,sys.stdin.readline().split())
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())
    Max = max(a*c, a*d, b*c, b*d)
    print(Max)
    
resolve()

Submission status: Accepted

Solution code:
# 178B
a,b,c,d = list(map(int, input().split()))
e = a*c
f = a*d
g = b*c
h = b*d
ans=[e,f,g,h]
print(max(ans))

Submission status: Accepted

Solution code:
import sys

def resolve(in_):
    a, b, c, d = map(int, next(in_).split())
    return max(a * c, b * d, b * c, a * d)
    

def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

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

ma = -10**18

for i in (a,b):
    for j in (c,d):
        ma = max(ma,i*j)

print(ma)

Submission status: Accepted

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

ans = -1e18
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())

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

Submission status: Accepted

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

Submission status: Accepted

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

score_list = []

for x in (a,b):
    for y in (c,d):
        score = x * y
        score_list.append(score)

print(max(score_list))

Submission status: Accepted

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

result = -1e21

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

print(result)

Submission status: Accepted

Solution code:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    # x = int(stdin.readline().rstrip())
    a,b,c,d = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    A = a * c
    B = b * d
    C = a * d
    D = b * c
    print(max(A,B,C,D))


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
## necessary imports
import sys
input = sys.stdin.readline
from bisect import bisect_left;
from bisect import bisect_right;
from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1;
    return x;
    
# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

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

## nCr function efficient using Binomial Cofficient
def nCr(n, k): 
    if(k > n - k): 
        k = n - k; 
    res = 1;
    for i in range(k): 
        res = res * (n - i);
        res = res / (i + 1); 
    return int(res);

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;


# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
# spf = [0 for i in range(MAXN)]
# spf_sieve();
def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret;
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));

## taking string array input
def str_array():
    return input().strip().split();

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

a, b, c, d = int_array();
ans = NINF;
for i in [a, b]:
    for j in [c, d]:
        ans = max(ans, i * j);

print(ans);

Submission status: Accepted

Solution code:
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

a, b, c, d = mi()

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())
ans1 = b*d
ans2 = b*c
ans3 = a*c
ans4 = a*d
ans = [ans1,ans2,ans3,ans4]
print(max(ans))

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
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)
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
ans = []

for i in range(2):
  ans.append(l[i] * l[2])
  ans.append(l[i] * l[3])

print(max(ans))

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math,sys,bisect,heapq
from collections import defaultdict,Counter,deque
from itertools import groupby,accumulate
#sys.setrecursionlimit(200000000)
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda: map(int,input().split())
alele = lambda: list(map(int, input().split()))
ilelec = lambda: map(int1,input().split())
alelec = lambda: list(map(int1, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
#MOD = 1000000000 + 7
def Y(c):  print(["NO","YES"][c])
def y(c):  print(["no","yes"][c])
def Yy(c):  print(["No","Yes"][c])

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


maxa=a*c
ans2=a*d
if maxa<ans2:
    maxa=ans2
ans3=b*c
if maxa<ans3:
    maxa=ans3
ans4=b*d
if maxa<ans4:
    maxa=ans4
print(maxa)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    # a, c が両方マイナスの場合, acとbdで比較
    print(max(a*c, b*d, a*d, b*c))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

input = sys.stdin.readline


def ST():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


a, b, c, d = MI()

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