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: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
num = []
if d < 0 and a > 0:
  print(a * d)
elif d > 0 and a > 0:
  print(b * d)
else:
  num = []
  for i in range(a, b + 1):
    for j in range(c, d + 1):
      num.append(i * j)
  print(max(num))

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
ans =-10000000000000000000000000000000
for i in range(a,b+1):
  for j in range(c,d+1):
      result = i*j
      if(result>ans):
          ans = result
print(ans)

Submission status: Time Limit Exceeded

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

if a == c and b == d:
    print(max(a*c, b*d))
    exit()
else:
    for i in range(a, b+1):
        for j in range(c, d+1):
            cnt = max(cnt,i*j)
            
print(cnt)

Submission status: Time Limit Exceeded

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

ans=[]
for i in range(li[0],li[1]+1):
  for j in range(li[2],li[3]+1):
    a=i*j
    ans.append(a)
    
print(max(ans))

Submission status: Time Limit Exceeded

Solution code:
def main():
  l=list(map(int,input().split()))
  x=[i for i in range(l[0],l[1]+1)]
  y=[j for j in range(l[2],l[3]+1)]
  all_pair=[i*j for i in x for j in y]
  print(sorted(all_pair)[-1])
if __name__=='__main__':
  main()

Submission status: Time Limit Exceeded

Solution code:

a,b,c,d = [int(x) for x in input().split()]
ans = -999999999999999
for i in range(a,b+1):
    for j in range(c,d+1):
        ans = max(ans,i*j)
        
print(ans)

Submission status: Time Limit Exceeded

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

maxi = float("-inf")
for i in range(a, b + 1):
  for j in range(c, d + 1):
    maxi = max(maxi, i * j)
print(maxi)

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
if a > 0 and b > 0 and c > 0 and d > 0:
  print(max(a,b)*max(c,d))
elif a == 0 or b == 0 or c == 0 or d == 0:
  print(max([a*c, a*d, b*c, b*d]))
else:
  res = []
  for i in range(a, b+1):
    for j in range(c, d+1):
      res.append(i*j)
  print(max(res))

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
M=-(10**20)

for i in range(a,b+1):
    for j in range(c,d+1):
        M=max(M,i*j)

print(M)

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
ma = a*c
for i in range(a, b+1):
    for j in range(c, d+1):
        if ma < i*j:
            ma = i*j
print(ma)

Submission status: Time Limit Exceeded

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

maxxy=a*c

for x in range(a,b+1):
    for y in range(c,d+1):
        if maxxy < x*y :
            maxxy=x*y
        
print(maxxy)

Submission status: Time Limit Exceeded

Solution code:
# B 
a, b, c, d = list(map(int, input().split(" ")))
maxnum = -1000000000
for i in range(b-a+1):
    x = a + i
    for j in range(d-c+1):
        y = c + j
        if x*y > maxnum:
            maxnum = x*y
print(maxnum)

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
num = []
for i in range(a, b + 1):
  for j in range(c, d + 1):
    num.append(i * j)
print(max(num))

Submission status: Time Limit Exceeded

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

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

Z = []
for i in range(b-a+1):
    x = i + a
    for j in range(d-c+1):
        y = j + c
        z = x * y
        Z.append(z)
print(max(Z))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int, input().split())
z= -1 * 10**9
for i in range(a,b+1):
    for j in range(c,d+1):
        p = (i * j)
        if p > z:
            z=p
print(z)

Submission status: Time Limit Exceeded

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

res = 'a'

for a in range(int(l[0]),int(l[1])+1):
    for b in range(int(l[2]),int(l[3])+1):
        tmp = a * b
        if res == 'a':
            res = tmp
        if res < tmp:
            res = tmp

print(res)

Submission status: Time Limit Exceeded

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

if a == c and b == d:
    print(max(a*c, b*d))
    exit()
else:
    for i in range(a, b+1):
        for j in range(c, d+1):
            cnt.append(i*j)
        
print(max(cnt))

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
ans=-999999999999999999
for i in range(a,b+1):
  for j in range(c,d+1):
    ans=max(ans,i*j)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=list(map(int,input().split()))
l=[]
for i in range(a,b+1):
  for j in range(c,d+1):
    l.append(i*j)
print(max(l))

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
ans=-float("inf")
for i in range(a,b+1):
    for j in range(c,d+1):
        ans=max(ans,i*j)
print(ans)

Submission status: Time Limit Exceeded

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

XY=[]

for i in range(a,b+1):
    for j in range(c,d+1):
        xy=i*j
        XY.append(xy)
        
print(max(XY))

Submission status: Time Limit Exceeded

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


maxx=a*c
for x in range(a,b+1):
    for y in range(c,d+1):
        z=x*y
        if z>maxx :
            maxx=z


print(maxx)

Submission status: Time Limit Exceeded

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


sum=-999999999999

for i in range(a[0],a[1]+1):
  for j in range(a[2],a[3]+1):
    sum=max(sum,i*j)

print(sum)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
res = []
for i in range(a, b+1):
  for j in range(c, d+1):
    res.append(i*j)
print(max(res))

Submission status: Time Limit Exceeded

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

a,b,c,d = map(int,input().split())
answer = -10000000001
for x in range(a,b+1):
    for y in range(c,d+1):
        answer = max(answer,x*y)
print(answer)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
s = []
for i in range(a, b+1):
  for j in range(c, d+1):
    s.append(i * j)
print(max(s))

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
X=a*c
for i in range(a,b+1) :
  for j in range(c,d+1) :
    X=max(X,i*j)
print(X)

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
ans = -10**9
for i in range(a,b+1):
  for j in range(c,d+1):
    ans = max(ans, i*j)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d=map(int,input().split())
l=[]
for i in range(a,b+1):
  for j in range(c,d+1):
    l.append(i*j)
    
print(max(l))

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = map(int, input().split())
ans = float('inf')*-1
for i in range(a, b+1):
  for j in range(c, d+1):
    ans = max(ans, i*j)

print(ans)

Submission status: Time Limit Exceeded

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

anses = []
for x in range(a, b + 1):
  for y in range(c, d + 1):
    anses.append(x * y)

print(max(anses))

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

print(max(result))

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


# 処理内容
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=[A*C,A*D,B*C,B*D]
print(max(lis))

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

top = a*c

for i in range(1,4):
    if top < val[i]:
        top = val[i]

print(top)

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())
x1 = a*c
x2 = a*d
x3 = b*c
x4 = b*d
x = [x1,x2,x3,x4]
print(max(x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Accepted

Solution code:
n1, n2, n3, n4 = [int(k) for k in input().split()]

print( max(n1* n3, n1 * n4, n2*n3, n2*n4))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c,d=list(map(int, input("").split()))
la=[]
lb=[]
if a<0 and b>0:
    la.append(0)
la.append(a)
la.append(b)
if c<0 and d>0:
    lb.append(0)
lb.append(c)
lb.append(d)
m=a*c
for i in la:
    for j in lb:
        o=i*j
        if o>m:
            m=o
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

ans = -1e30
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())
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())
if a<0:
    candi = a*c
else:
    candi = a*d

if b<0:
    candi2 = b*c
else:
    candi2 = b*d

print(max(candi, candi2))

Submission status: Accepted

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

Submission status: Accepted

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

temp1 = a*c
temp2 = a*d
temp3 = b*c
temp4 = b*d

answer = max(temp1,temp2,temp3,temp4)

print(answer)

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

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())
ans=[]
for X in [a,b]:
  for Y in [c,d]:
    ans.append(X*Y)
print(max(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os,sys
a=input().split(' ')
n=[int(i) for i in a]
m=[n[0]*n[2],n[0]*n[3],n[1]*n[2],n[1]*n[3]]
print(max(m))

Submission status: Accepted

Solution code:
import sys

# B - Product Max
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=(int(x) for x in 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())

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

print(e)

Submission status: Accepted

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

print(max(li))

Submission status: Accepted

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

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

Submission status: Accepted

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

matrix = sorted(matrix, reverse=True)

print(str(matrix[0]))

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

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

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

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

Submission status: Accepted

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

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 sys
from functools import reduce


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


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

Submission status: Accepted

Solution code:
nums = input().split()
ab = [int(nums[0]), int(nums[1])]
cd = [int(nums[2]), int(nums[3])]

res = []

for i in ab:
  for j in cd:
    tmp = i * j
    res.append(tmp)
    
print(max(res))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, c, d = map(int, input().split())
    candidate = [a*c, a*d, b*c, b*d]
    print(max(candidate))
        
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def get_ints(): return map(int, sys.stdin.readline().strip().split())
a,b,c,d=get_ints()
pro=[a*c,a*d,b*c,b*d]
print(max(pro))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list=input().split(" ")

list1=[list[0], list[1]]
list2=[list[2], list[3]]

list_a=[int(x)*int(y) for x in list1 for y in list2]

print(max(list_a))

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


a, b, c, d = i_map()

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
ans = -float('inf')
for i in range(2):
    for j in range(2,4):
        ans = max(ans,a[i]*a[j])
print(ans)

Submission status: Accepted

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

result = [i * j for i in [a, b] for j in [c, d]]
print(max(result))

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

Submission status: Accepted

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


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

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 MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
A,B,C,D=MI()
ans1=A*C
ans2=A*D
ans3=B*C
ans4=B*D
Max=max(ans1,ans2,ans3,ans4)
if A<=0<=B or C<=0<=D:
  Max=max(0,Max)
print(Max)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
input = stdin.readline


def main():
    a, b, c, d = list(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 = [int(i) for i in input().split(" ")]

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
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
import numpy as np
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:
def a():
  a = list(map(int,input().split()))
  max1 = max(a[0], a[1])
  min1 = min(a[0], a[1])
  max2 = max(a[2], a[3])
  min2 = min(a[2], a[3])
  result = [max1 * max2, max1 * min2, min1 * max2, min1 * min2]
  return max(result)

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

Submission status: Accepted

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

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())
xy1 = xy2 = xy = 0

k = a*c
l = a*d
m = b*c
n = b*d

if k >= l:
    xy1 = k
else:
    xy1 = l

if m >= n:
    xy2 = m
else:
    xy2 = n

if xy1 >= xy2:
    xy = xy1
else:
    xy = xy2

print(xy)

Submission status: Accepted

Solution code:
def get_ints() :
  return list(map(int,input().split()))

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

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

sorted = sorted([ac, ad, bc, bd])
print(sorted[3])

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:
def gets_ints():
    return list(map(int, input().split()))

a,b,c,d=gets_ints()
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:
#template
def inputlist(): return [int(j) for j in input().split()]
#template
a,b,c,d = inputlist()
print(max(a*c,a*d,b*c,b*d))

Submission status: Accepted

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

if (a<0<b or c<0<d) and max(prd)<0:
    print(0)
else:
    print(max(prd))

Submission status: Accepted

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

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:
l=list(map(int, input().split()))
l1=[l[0],l[1]]
l2=[l[2],l[3]]
ans=l[0]*l[2]
for i in l1:
  for j in l2:
    if i*j>ans:
      ans=i*j
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c, d = [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 = [int(e) for e 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 = -float("inf")
for x in [a, b]:
    for y in [c, d]:
        tmp = x*y
        ans = max(ans, tmp)
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    a,b,c,d = map(int, readline().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 = -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:
#!/usr/bin/env python3

import sys

input = iter(sys.stdin.read().splitlines()).__next__

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

A = [a, b]
if a < 0 and b > 0:
   A.append(0)

B = [c, d]
if c < 0 and d > 0:
   B.append(0)

res = -1000000000000000001
for x in A:
   for y in B:
      res = max(res, x*y)

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
b = [0, 0, 0, 0]

b[0] = a[0]*a[2]
b[1] = a[0]*a[3]
b[2] = a[1]*a[2]
b[3] = a[1]*a[3]

b.sort()

print(b[3])

Submission status: Accepted

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

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

sys.setrecursionlimit(1000000)


def main():
    a, b, c, d = map(int, input().split())
    
    max_ab = max(a, b)
    min_ab = min(a,b)
    max_cd = max(c,d)
    min_cd = min(c,d)
    
    # ab ++
    if min_ab >= 0:
        # cd ++
        if min_cd >= 0:
            # ++
            print(max_ab * max_cd)
        # cd +-
        elif max_cd >= 0:
            # ++
            print(max_ab * max_cd)
        # cd --
        else:
            # +-
            print(min_ab * max_cd)
    # ab +-
    elif max_ab >= 0:
        # cd ++
        if min_cd >= 0:
            # ++
            print(max_ab * max_cd)
        # cd +-
        elif max_cd >= 0:
            # ++ or --
            print(max(max_ab * max_cd, min_ab * min_cd))
        # cd --
        else:
            # --
            print(min_ab * min_cd)
    # ab --
    else:
        # cd ++
        if min_cd >= 0:
            # -+
            print(max_ab * min_cd)
        # cd +-
        elif max_cd >= 0:
            # --
            print(min_ab * min_cd)
        # cd --
        else:
            # --
            print(min_ab * min_cd)


main()

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, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
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:
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())
list = [a*c, a*d, b*c, b*d]
print(max(list))

Submission status: Accepted

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

Submission status: Accepted

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

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

print (max(anslist))

Submission status: Accepted

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

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

a,b,c,d = readints()

ans = -10**20

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