Problem:


Score : 200 points

Problem Statement

Given are integers a,b,c and d.
If x and y are integers and a \leq x \leq b and c\leq y \leq d hold, what is the maximum possible value of x \times y?

Constraints

-10^9 \leq a \leq b \leq 10^9

-10^9 \leq c \leq d \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

a b c d

Output

Print the answer.

Sample Input 1

1 2 1 1

Sample Output 1

2

If x = 1 and y = 1 then x \times y = 1.
If x = 2 and y = 1 then x \times y = 2.
Therefore, the answer is 2.

Sample Input 2

3 5 -4 -2

Sample Output 2

-6

The answer can be negative.

Sample Input 3

-1000000000 0 -1000000000 0

Sample Output 3

1000000000000000000



Sample input:
1 2 1 1


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

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

list = []
list.append(a*c)
list.append(a*d)
list.append(b*c)
list.append(b*d)
print(max(list))

Submission status: Accepted

Solution code:
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10
    a,b,c,d = LMIIS()
    ans = -10**20
    for i in [a,0,b] if a<= 0 <= b else [a,b]:
        for j in [c,0,d] if c <= 0 <= d else [c,d]:
            ans = max(ans,i*j)
    print(ans)
    
main()

Submission status: Accepted

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


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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


def maximize_product(a, b, c, d):
    return max(a * c, a * d, b * c, b * d)


def main():
    a, b, c, d = (int(z) for z in input().split())
    res = maximize_product(a, b, c, d)
    print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]
#CW = [list(map(int, list(input()))) for _ in range(H)]


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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

if a*d > result:
  result = a*d
if b*c > result:
  result = b*c
if b*d > result:
  result = b*d

print(result)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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());print(max(x*y for y in [c,d]for x in [a,b]))

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

# a * c

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

print(max(result))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from typing import List, Any


def read_int() -> int:
    return int(input().strip())


def read_ints() -> List[int]:
    return list(map(int, input().strip().split(' ')))


def solve() -> Any:
    a, b, c, d = read_ints()
    return max(a*d, a*c, b*c, b*d)


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

Submission status: Accepted

Solution code:
import os
import heapq
import sys,threading
import math as mt
import operator
from copy import copy
from collections import defaultdict,deque
from io import BytesIO, IOBase

sys.setrecursionlimit(2*10 ** 5)
#threading.stack_size(2**27)


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


"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""


def inpt():
    return [int(k) for k in input().split()]

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





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()
    #threading.Thread(target=main).start()

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

print(max(p))

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
x1 = a * c
x2 = a * d
x3 = b * d
x4 = b * c
m = max(x1, x2, x3, x4)
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

    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))
if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2020/09/13
# AtCoder Beginner Contest 178 - B

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

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

# Output
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

a,b,c,d = readIntList()

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

Submission status: Accepted

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

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

ans = a * c
for i in x:
    for j in y:
        ans = max(ans, i * j)

print(ans)

Submission status: Accepted

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

@author: NEC-PCuser
"""

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

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

print(max_num)

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

Submission status: Accepted

Solution code:
a,b,c,d=map(int,input().split())
ans=-10**18
for num1 in [a,b]:
    for num2 in [c,d]:
        ans=max(ans,num1*num2)
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 <= B or C <= 0 <= D:
    ans = max(0, ans)
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)
print(ans)

Submission status: Accepted

Solution code:
import math
import itertools


# 与えられた数値の桁数と桁値の総和を計算する.
def calc_digit_sum(num):
    digits = sums = 0
    while num > 0:
        digits += 1
        sums += num % 10
        num //= 10
    return digits, sums


a, b, c, d = map(int, input().split())
answer = float('-inf')
for x in [a,b]:
    for y in [c, d]:
        answer = max(answer, x * y)

print(answer)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C,D = list(map(int,input().split()))
L = [A,B]
M = [C,D]
out = []
if A<=0 and B>=0:
    L.append(0)
if C<=0 and D>=0:
    M.append(0)
for i in L:
    for j in M:
        out.append(i*j)
print(max(out))

Submission status: Accepted

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

ans=-float('inf')

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
mod=1000000007
ans=-pow(10,19)
arr=list(map(int,input().split()))
for i in range(0,2):
    for j in range(2,4):
        ans=max(ans,arr[i]*arr[j])
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)

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
ans_cand = [ac, ad, bc, bd]
ans = max(ans_cand)

print(ans)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    a, b, c, d = MI()
    temp = [a*c, a*d, b*c, b*d]
    ans = max(temp)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    ac = a*c
    ad = a*d
    bc = b*c
    bd = b*d
    print(max(ac, ad, bc, bd))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## for use in beginner level questions where speed is key
## and also for single test case code
## mastercopy for x,y,z

import sys
import heapq, functools, collections
import random
from collections import Counter, defaultdict

# read line as a string
# strr = input()

# read line as an integer
# k = int(input())

# read one line and parse each word as a string
# lst = input().split()

# read one line and parse each word as an integer
a,b,c,d = list(map(int,input().split()))

if a <= 0 <= b:
    xx = [a,0,b] 
else:
    xx = [a,b]

if c <= 0 <= d:
    yy = [c,0,d]
else:
    yy = [c,d]

maxres = -10**18
for x in xx:
    for y in yy:
        maxres = max(maxres, x*y)

print(maxres)

Submission status: Accepted

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

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

print(max(ans_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""AtCoder Beginner Contest 178.

B
"""

import sys


def input() -> str:  # noqa: A001
    """Input."""
    return sys.stdin.readline()[:-1]


def main():
    """Run."""
    a, b, c, d = 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)


main()

Submission status: Accepted

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

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

print(max(lst))

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:
a = list(map(int,input().split()))
print(max(a[0]*a[2],a[1]*a[3],a[0]*a[3],a[1]*a[2]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = -10000000000000000001

if l[0] * l[2] >= ans:
    ans = l[0] * l[2]
if l[0] * l[3] >= ans:
    ans = l[0] * l[3]
if l[1] * l[2] >= ans:
    ans = l[1] * l[2]
if l[1] * l[3] >= ans:
    ans = l[1] * l[3]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

x = a*c
y = a*d
z = b*c
w = b*d

print(max(x,y,z,w))

Submission status: Accepted

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

Submission status: Accepted

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

max_mul = -1 * 10**18

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

print(max_mul)

Submission status: Accepted

Solution code:
import sys
import math

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

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

Submission status: Accepted

Solution code:
def li():
    return [int(x) for x in input().split()]


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(xy)

Submission status: Accepted

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

Submission status: Accepted

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

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:
#Python Template

from sys import stdin, stdout

def main():
	a, b, c, d = [int(i) for i in stdin.readline().split()]
	ans = max(a*c, a*d, b*c, b*d)
	print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

ans=a*c
if a*d > ans: ans=a*d
if b*c > ans: ans=b*c
if b*d > ans: ans=b*d

print(ans)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys
gcd = math.gcd
a,b,c,d = ma()
a1 = a*c
a2 = a*d
a3 = b*c
a4 = b*d
print(max(a1,a2,a3,a4))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c, d = map(int, input().split())
AB = [a, b]
CD = [c, d]
ans = []
for i in AB:
    for s in CD:
        ans.append(i*s)
print(max(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import trunc
import sys
import copy
from collections import deque
import collections
import itertools
stdin = sys.stdin
import math

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

a = na()

ans = []

ans.append(a[0]*a[2])
ans.append(a[0]*a[3])
ans.append(a[1]*a[2])
ans.append(a[1]*a[3])

print(max(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
print(max(A, max(B, max(C, D))))

Submission status: Accepted

Solution code:

def ii(): return int(input())


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


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


a, b, c, d = mi()

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

Submission status: Accepted

Solution code:
def b():
    a, b, c, d = map(int, input().split())
    res1 = max(a * c, a * d)
    res2 = max(b * c, b * d)
    res = max(res1, res2)
    print(res)
    
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())
ans = float('inf')*-1
ans = max(ans, a*c)
ans = max(ans, a*d)
ans = max(ans, b*c)
ans = max(ans, b*d)
print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()

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

outs = []
xs = [a, b]
ys = [c, d]
for x in xs:
    for y in ys:
        out = x*y
        outs.append(out)

out = max(outs)
print(out)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import os
from sys import stdin, stdout


def solve(tc):
    a, b, c, d = map(int, stdin.readline().split())

    ans = int(-1e19)
    ans = max(ans, a*c)
    ans = max(ans, b*d)
    ans = max(ans, a*d)
    ans = max(ans, b*c)
    print(ans)


tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

Submission status: Accepted

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

import sys


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


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

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

Submission status: Accepted

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

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