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: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
ans = 0
if b != 0 and d != 0:
    if c < 0:
        ans = a * d
    else:
        ans = b * d
else:
    ans = min(a, b) * min(c, d)

print(ans)

Submission status: Wrong Answer

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

mini = arr[0] * arr[1]
maxi = arr[-1] * arr[-2]

print(max(mini, maxi))

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int, input().split())
import numpy as np
A = np.matrix([[a],[b]])
C = np.matrix([c,d])
print(A.shape)
print(C.shape)
X = np.dot(A,C)
print(np.max(X))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -1000100100100
for i in x:
    for j in y:
        ans = max(ans, i*j)

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

ab = int(a)*int(b)
ac = int(a)*int(c)
ad = int(a)*int(d)
bc = int(b)*int(c)
bd = int(b)*int(d)
cd = int(c)*int(d)

x = [ab, ac, ad, bc, bd, cd]
print(max(x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

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

print(e)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(i) for i in input().split()]
list1 = [a,b]
list2 = [c,d]
ans = 0
max = float("-inf")
print(list1)
for i in list1:
  for j in list2:
    ans = i * j
    if (ans > max):
      max = ans
print(max)

Submission status: Wrong Answer

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

print(max([ans1, ans2]))

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
m = a*c
if a*d > m:
  m = a*d
elif b*c > m:
  m = b*c
elif b*d > m:
  m = b*d
 
print(m)

Submission status: Wrong Answer

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

print(max)

Submission status: Wrong Answer

Solution code:
def countmax(a,b,c,d):
  list=[]
  list.append(a*b)
  list.append(b*c)
  list.append(c*d)
  list.append(d*a)
  return max(list)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if abs(a) >= abs(b):
    x = a
else:
    x = b

if abs(c) >= abs(d):
    y = c
else:
    y = d

if x*y <= 0:
    if abs(a) >= abs(b):
        x = b
    else:
        x = a

    if abs(c) >= abs(d):
        y = d
    else:
        y = c

print(x*y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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))
else:
    print(min(abs(a), abs(b)) * min(abs(c), abs(d)))

Submission status: Wrong Answer

Solution code:
import itertools
l=list(map(int, input().split()))
c=itertools.combinations(l,2)
ans=l[0]*l[1]
for i in c:
  if i[0]*i[1]>ans:
    ans=i[0]*i[1]
print(ans)

Submission status: Wrong Answer

Solution code:
x = input().split()
a = int(x[1])
b = int(x[3])
print(a*b)

Submission status: Wrong Answer

Solution code:
import numpy as np

l = list(map(int, input().split()))
[a, b, c, d] = l
[A, B, C, D] = np.abs(l)
[ab, cd, abcd, bc, Bb, ac] = [a*b, c*d, a*b*c*d, b*c, B*b, a*c]
if abcd>=0:
    if bc<0:
        if Bb<0:
            print(b*c)
        elif a<0:
            print(b*d)
        else:
            print(a*d)
    elif a>=0:
        print(b*d)
    else:
        print(a*c)
elif Bb<0:
    print(a*c)
elif bc<0:
    if ac<0:
        print(b*d)
    else:
        print(a*c)

else:
    print(b*d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(e) for e in input().split(" ")]
if((0 <= a or 0 <= c) and (0 <= b and 0 <= d)):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))
elif(a < 0 and 0 <= b and c < 0 and d < 0):
    print(a * c)
elif(a < 0 and b < 0 and c < 0 and 0 <= d):
    print(a * c)

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(e) for e in input().split(" ")]
if((0 <= a or 0 <= c) and (0 <= b and 0 <= d)):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(e) for e in input().split(" ")]
#print(a, b, c, d)
if(0 <= a or 0 <= c):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(e) for e in input().split(" ")]
print(a, b, c, d)
if(0 <= a or 0 <= c):
    #print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    #print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    #print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    #print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))

Submission status: Wrong Answer

Solution code:
a, b, c, d = [int(e) for e in input().split(" ")]
print(a, b, c, d)
if(0 <= a or 0 <= c):
    print("A")
    print(b * d)
elif((a < 0 and b < 0) and (0 <= c and 0 <= d)):
    print("B")
    print(b * c)
elif((c < 0 and d < 0) and (0 <= a and 0 <= b)):
    print("C")
    print(d * a)
elif(a < 0 and b < 0 and c < 0 and d < 0):
    print("D")
    print(a * d)
elif((a < 0 and 0 <= b) and (c < 0 and 0 <= d)):
    print(max((a * c), (b * d)))

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(1000000)


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

    ma = max(abs(a), abs(b)) * max(abs(c), abs(d))
    if ma >= 0:
        print(ma)
    else:
        if max(a, b) < 0:
            if min(c, d) < 0:
                # - -
                print(min(a, b) * min(c, d))
            else:
                # - +
                print(max(a, b) * min(c, d))
        elif max(c, d) < 0:
            if min(a, b) < 0:
                # - -
                print(min(c, d) * min(a, b))
            else:
                # - +
                print(max(c, d) * min(a, b))

main()

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(1000000)


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

    ma = max(a, b) * max(c, d)
    if ma >= 0:
        print(ma)
    else:
        if max(a, b) < 0:
            if min(c, d) < 0:
                # - -
                print(min(a, b) * min(c, d))
            else:
                # - +
                print(max(a, b) * min(c, d))
        elif max(c, d) < 0:
            if min(a, b) < 0:
                # - -
                print(min(c, d) * min(a, b))
            else:
                # - +
                print(max(c, d) * min(a, b))

main()

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(1000000)


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

    abs_a = abs(a)
    abs_b = abs(b)
    abs_c = abs(c)
    abs_d = abs(d)

    ma = max(abs_a, abs_b) * max(abs_c, abs_d)
    if ma >= 0:
        print(ma)
    else:
        if max(abs_a, abs_b) < 0:
            if min(abs_c, abs_d) < 0:
                print(min(abs_a, abs_b) * min(abs_c, abs_d))
            else:
                print(max(abs_a, abs_b) * min(abs_c, abs_d))
        elif max(abs_c, abs_d) < 0:
            if min(abs_a, abs_b) < 0:
                print(min(abs_c, abs_d) * min(abs_a, abs_b))
            else:
                print(max(abs_c, abs_d) * min(abs_a, abs_b))

main()

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(1000000)


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

    abs_a = abs(a)
    abs_b = abs(b)
    abs_c = abs(c)
    abs_d = abs(d)
    
    ma = max(abs_a, abs_b) * max(abs_c, abs_d)
    if ma < 0:
        print(0)
    else:
        print(ma)


main()

Submission status: Wrong Answer

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

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

f=c*e
g=b*d
h=c*d

if b>=0:
    if d>=0:
        print(f)
    else:
        print(h)

else:
    if c>=0:
        if d>=0:
            print(f)
        else:
            if e>=0:
                if g>f:
                    print(g)
                else:
                    print(f)
            else:
                print(g)
    else:
        if d>=0:
            print(h)
        else:
            print(g)

Submission status: Wrong Answer

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

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

f=c*e
g=b*d
h=c*d

if b>=0:
    print(f)

else:
    if c>=0:
        if d>=0:
            print(f)
        else:
            if e>=0:
                if g>f:
                    print(g)
                else:
                    print(f)
            else:
                print(g)
    else:
        if d>=0:
            print(h)
        else:
            print(g)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, open(0).read().split())
max_n = a*b
for x in [a, b, c, d]:
  for y in [a, b, c, d]:
    if max_n < x*y:
      max_n = x*y
print(max_n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
arr = input().split()

a = int(arr[0])
b = int(arr[1])

c = int(arr[2])
d = int(arr[3])

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

x2 = min(a,b)
y2 = min(c,d)

ans = max(x*y,x2*y2)

print(ans)

Submission status: Wrong Answer

Solution code:
arr = input().split()
a = int(arr[0])
b = int(arr[1])

c = int(arr[2])
d = int(arr[3])

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

print(x*y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nums = input().split(' ')
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
d = int(nums[3])

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

ans = - 10 ** 9
for i in range(4):
    if multi[i] > ans:
        ans = multi[i]

print(ans)

Submission status: Wrong Answer

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

# 場合分け
# a*c, a*d, b*c, b*dがあり得る

if a < 0 and b < 0: # どっちもマイナス
    if c < 0 and d < 0: # どっちもマイナス
        answer = a * c
    elif c < 0 and d >= 0:#小さいほうがマイナス
        answer = a * c
    elif c >= 0 and d >= 0:# どっちもプラス
        answer = c * b

elif a < 0 and b >= 0: #　小さいほうがマイナス
    if c < 0 and d < 0:# どっちもマイナス
        answer = a *c 
    elif c < 0 and d >= 0:#小さいほうがマイナス
        answer = max(a * c, b * d)
    elif c >= 0 and d >= 0:# どっちもプラス
        answer = b * c

elif a >= 0 and b >= 0: # どっちもプラス
    if c < 0 and d < 0:# どっちもマイナス
        answer = a * d
    elif c < 0 and d >= 0:#小さいほうがマイナス
        answer = b * d
    elif c >= 0 and d >= 0:# どっちもプラス
        answer = b * d

print(answer)















# # ------ A --------
# x = int(input())

# if x == 0:
#     print(1)
# elif x == 1
#     print(0)
# else:
#     pass

# 型
# >>文字列：string 整数：integer, 少数:float 
# =は代入、==は等しい

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
#from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *
from bisect import *	
#from heapq import *
#from math import ceil
#from itertools import permutations ,product
 
def eprint(*args):
    print(*args, file=sys.stderr)
zz=1
 
#sys.setrecursionlimit(10**6)
if zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('all.txt','w')
di=[[-1,0],[1,0],[0,1],[0,-1]]
def inc(d,c,x=1):
	d[c]=d[c]+x if c in d else x
def bo(i):
	return ord(i)-ord('A')	
def li():
	return [int(xx) for xx in input().split()]
def fli():
	return [float(x) for x in input().split()]	
def comp(a,b):
	if(a>b):
		return 2
	return 2 if a==b else 0		
def gi():	
	return [xx for xx in input().split()]
def fi():
	return int(input())
def pro(a): 
	return reduce(lambda a,b:a*b,a)		
def swap(a,i,j): 
	a[i],a[j]=a[j],a[i]	
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())			
def gh():
	sys.stdout.flush()
def isvalid(i,j):
	return 0<=i<n and 0<=j<m and a[i][j]!="."
def bo(i):
	return ord(i)-ord('a')	
def graph(n,m):
	for i in range(m):
		x,y=mi()
		a[x].append(y)
		a[y].append(x)
def represent(n):
	s=""
	while n>0:
		s+=str(n%3)
		n//=3
	s=s[::-1]
	return s			

t=1
while t>0:
	t-=1
	a,b,c,d=mi()
	maxi=-10*19
	for i in a,b:
		for j in c,d:
			maxi=max(maxi,i*j)		
	print(maxi)

Submission status: Wrong Answer

Solution code:
import sys
#from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *
from bisect import *	
#from heapq import *
#from math import ceil
#from itertools import permutations ,product
 
def eprint(*args):
    print(*args, file=sys.stderr)
zz=1
 
#sys.setrecursionlimit(10**6)
if zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('all.txt','w')
di=[[-1,0],[1,0],[0,1],[0,-1]]
def inc(d,c,x=1):
	d[c]=d[c]+x if c in d else x
def bo(i):
	return ord(i)-ord('A')	
def li():
	return [int(xx) for xx in input().split()]
def fli():
	return [float(x) for x in input().split()]	
def comp(a,b):
	if(a>b):
		return 2
	return 2 if a==b else 0		
def gi():	
	return [xx for xx in input().split()]
def fi():
	return int(input())
def pro(a): 
	return reduce(lambda a,b:a*b,a)		
def swap(a,i,j): 
	a[i],a[j]=a[j],a[i]	
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())			
def gh():
	sys.stdout.flush()
def isvalid(i,j):
	return 0<=i<n and 0<=j<m and a[i][j]!="."
def bo(i):
	return ord(i)-ord('a')	
def graph(n,m):
	for i in range(m):
		x,y=mi()
		a[x].append(y)
		a[y].append(x)
def represent(n):
	s=""
	while n>0:
		s+=str(n%3)
		n//=3
	s=s[::-1]
	return s			

t=1
while t>0:
	t-=1
	a,b,c,d=mi()
	print(b*d)

Submission status: Wrong Answer

Solution code:
a, b, c, d = map(int, input().split())
ans = 1
aa, bb, cc, dd = abs(a), abs(b), abs(c), abs(d)

if aa <= bb and cc <= dd:
    ans = b * d
elif aa > bb and cc <= dd:
    ans = b * c
elif aa <= bb and cc > dd:
    ans = a * d
else:
    ans = a * c  

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
e = a*c
f = a*d
g = b*c
h = b*d
xy =[e,f,g,h]
max(xy)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

AC = int(A)*int(C)
BD = int(B)*int(C)

if AC > BD:
  print(AC)
  
else:
  print(BD)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
x = [int(i) for i in x.split(" ")]
y = x[1] * x[3]
print(y)

Submission status: Wrong Answer

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

ans = 0

if ans < a*c:
    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: Wrong Answer

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

Submission status: Wrong Answer

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

if b < 0:
  if d < 0:
    print(a*c)
  else:
    print(b*c)
else:
  if d < 0:
    print(a*d)
  else:
    print(b*d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
lst = [ int(i) for i in input().split() ]

ans = sorted(lst)

print(ans[-1]*ans[-2])

Submission status: Wrong Answer

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


m()

Submission status: Wrong Answer

Solution code:
a, b, c, d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
def m():
    if -10^9 <=a<=b<=10^9 and -10^9<=c<=d<=10^9:
        if a>=0 and d<=0:
            max=a*d
            print(max)
        elif a>=0 and c>=0:
            max=b*d
            print(max)
        elif b<=0 and c>=0:
            max=b*c
            print(max)
        elif b<=0 and d<=0:
            max=a*c
            print(max)
        elif a<=0 and b>=0 and c<=0 and d>=0:
            if a*c>=b*d:
                max=a*c
                print(max)
            else:
                max=b*d
                print(max)
        elif a>=0 and c<=0 and d>=0:
            max=b*d
            print(max)
        elif b<=0 and c<=0 and d>=0:
            max=a*c
            print(max)
        elif a<=0 and b>=0 and c>=0:
            max=b*d
            print(max)


m()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c, d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
def m():
    if a<=b and c<=d:
        max=a*b+c*d
        print(max)
    else:
        print("plese press again")
m()

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
def getmax(a,b):
    if a>b:
        return a
    else:
        return b
x = getmax(a,b)
y = getmax(c,d)
MAX = x*y
def getmin(a,b):
    if a<b:
        return a
    else:
        return b
x1 = getmin(a,b)
y1 = getmin(c,d)
MIN = x1*y1
if (MAX > 0 and MIN > 0) or (MAX < 0 and MIN < 0):
    if MAX > MIN:
        print(MAX)
    else:
        print(MIN)
else:
    x = getmax(a,b)
    MAX = x*y
    x = getmin(a,b)
    y = getmax(c,d)
    MIN = x*y
    if MAX > MIN:
        print(MAX)
    else:
        print(MIN)

Submission status: Wrong Answer

Solution code:
a,b,c,d = map(int,input().split())
def getmax(a,b):
    if a>b:
        return a
    else:
        return b
x = getmax(a,b)
y = getmax(c,d)
MAX = x*y
def getmin(a,b):
    if a<b:
        return a
    else:
        return b
MIN = x*y
if MAX > MIN:
    print(MAX)
else:
    print(MIN)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = [int(a[0]),int(a[1])]
y = [int(a[2]),int(a[3])]

max = -1000000000
for i in x:
  for j in y:
    s = i*j
    
    if max < s:
      max = s
print(max)

Submission status: Wrong Answer

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

x = [int(a[0]),int(a[1])]
y = [int(a[2]),int(a[3])]

max = -100000000
for i in x:
  for j in y:
    s = i*j
    
    if max < s:
      max = s
print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import inf
a,b,c,d = map(int, input().split())
if b < a:
  b, a = a, b
if d < c:
  c, d = d, c
high = -inf
for i in range(b, a):
  for j in range(d, c):
    prod = i*j
    if high < prod:
      high = prod
print(high)