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: Runtime Error

Solution code:
a= int(input())
b= int(input())
c= int(input())
d= int(input())
e = a * c;
f = a * d;
g = b * c;
h = b * d;
if (e > f) f = e
if (g > h) h = g
if (f > h) h = f;
print(h)

Submission status: Runtime Error

Solution code:
import math
a, b, c, d = map(int, input().split())
ac = a * c
ad = a * d
bc = b * c
bd = b * d
ans_1 = math.max(ac,ad)
ans_2 = math.max(bc, bd)
ans = math.max(ans1_, ans2)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,d=(int(z) for z in input().split())
xcalc = 0
ycalc = 0
if -10**9 <= a <= xcalc <= b <= 10**9:
    xcalc = list(range(a,b))
if -10**9 <= c <= ycalc <= d<= 10**9:
    ycalc = list(range(c,d))

for i in range(len(xcalc)):
    for j in range(len(ycalc)):
        if max1 < i and max2 <j:
            max = max1 * max2
            break
print(max)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
n1 = a * c
n2 = bd
n3 = cb
n4 = d*a
print(max(n1,n2,n3,n4))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(raw_input().split())
m = a*c
n = a*d
o = b*c
p = b*d
if(m>n and m>o and m>p):
    print(m)
elif (n>m and n>o and n>p):
    print(n)
elif (o> m and o>n and o>p):
    print(o)
else:
    print(p)

Submission status: Runtime Error

Solution code:
x = map(int,input().split())
list1 = list(x)
list2 = list(range(list1[0],list1[1]+1 ))
list3 = list(range(list1[2],list1[3]+1 ))
list4 = [min(list2)*min(list3),min(list2)*max(list3),max(list2)*min(list3),max(list2)*max(list3)]
a = max(list4)
print(a)

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, raw_input().split())
m = a*c
n = a*d
o = b*c
p = b*d
if(m>n and m>o and m>p):
    print(m)
elif (n>m and n>o and n>p):
    print(n)
elif (o> m and o>n and o>p):
    print(o)
else:
    print(p)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if -10**9 <= a <= x <= b <= 10**9:
    xcalc = list(range(a,b))
if -10**9 <= c <= y <= d<= 10**9:
    ycalc = list(range(c,d))

for i in range(len(xcalc)):
    for j in range(len(ycalc)):
        if max1 < i and max2 <j:
            max = max1 * max2
            break
print(max)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if a>=0 and c>=0:
    (x,y) = (b,d)
elif a<0 and b>=0 and c>=0:
    (x,y) = (b,d)
elif a>=0 and c<0 and d>=0:
    (x,y) = (b,d)
elif b<0 and c>=0:
    (x,y) = (b,c)
elif a>=0 and d<0:
    (x,y) = (a,d)
elif b<0 and c<0 and d>=0:
    (x,y) = (a,c)
elif a<0 and b>=0 and d<0:
    (x,y) = (a,c)
elif b<0 and d<0:
    (x,y) = (a,c)

print (x*y)

Submission status: Runtime Error

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

if -10**9 <= a <= x <= b <= 10**9:
    xcalc = list(range(a,b))
if -10**9 <= c <= y <= d<= 10**9:
    ycalc = list(range(c,d))

for i in range(len(xcalc))
    for j in range(len(ycalc))
        if max1 < i and max2 <j:
            max = max1 * max2
            break
print(max)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

x = False
y = False

if max(n[0],n[1]) < 0:
    x = True
    
if max(n[2],n[3]) < 0:
    y = True

if n[1] > 0:
    if n[3] > 0:
        ans = n[1] * n[3]
    else:
        if n[0] < 0:
            ans = n[0] * n[2]
        else:
            ans = n[0] * n[3]
elif n[3] > 0:
    if n[2] < 0:
        ans = n[0] * n[2]
    else:
        ans = n[1] * n[2]
if n[1] == 0 and n[3] == 0:
    ans = n[0] * n[2]

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if a>=0 and c>=0:
    (x,y) = (b,d)
elif a<=0 and b>=0 and c>=0:
    (x,y) = (b,d)
elif a>=0 and c<=0 and d>=0:
    (x,y) = (b,d)
elif b<=0 and c>=0:
    (x,y) = (b,c)
elif a>=0 and d<=0:
    (x,y) = (a,d)
elif b<=0 and c<=0 and d>=0:
    (x,y) = (a,c)
elif a<=0 and b>=0 and d<=0:
    (x,y) = (a,c)
elif b<=0 and d<=0:
    (x,y) = (a,c)

print (x*y)

Submission status: Runtime Error

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

if a>=0 and c>=0:
    (x,y) = (b,d)
elif a<=0 and b>=0 and c>=0:
    (x,y) = (b,d)
elif a>=0 and c<=0 and d>=0:
    (x,y) = (b,d)
elif b<~0 and c>=0:
    (x,y) = (b,c)
elif a>=0 and d<=0:
    (x,y) = (a,d)
elif b<=0 and c<=0 and d>=0:
    (x,y) = (a,c)
elif a<=0 and b>=0 and d<=0:
    (x,y) = (a,c)
elif b<~0 and d<=0:
    (x,y) = (a,c)

print (x*y)

Submission status: Runtime Error

Solution code:
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]
A = np.arange(a,b+1).reshape(1,-1)
B = np.tile(np.arange(c, d+1), (len(A),1))
m = np.matmul(A.T, B)
print(np.max(m))

Submission status: Runtime Error

Solution code:
x = map(int,input().split())
list1 = list(x)
list2 = list(range(list1[0],list1[1]+1 ))
list3 = list(range(list1[2],list1[3]+1 ))
list4 = []
for i in list2:
  for l in list3:
      list4_a = list4.append(l*i)
a = max(list4)
print(a)

Submission status: Runtime Error

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

max_i = -10**9 - 1
max_j = -10**9 - 1
min_i = 10**9 + 1
min_j = 10**9 + 1

for i in range(a, b+1):
    if i > max_i:
        max_i = i
    if i < min_i:
        min_i = i


for j in range(c, d+1):
    if j > max_j:
        max_j = j

    if j < min_j:
        min_j = j

if max_i < 0:
    print(max_i * min_j)

elif max_j < 0:
    print(max_j * min_i)

else:
    print(max_i * max_j)

Submission status: Runtime Error

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

x = range(a,b+1)
y = range(c,d+1)

X = list(x)
Y = list(y)

max = X[0] * Y[0]

for i in range(1, len(X)):
	for j in range(1, len(Y)):
		if max < X[i] * Y[j]:
			max = X[i] * Y[j]
print(max)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
aa = a*c
bb = a*d
cc = b*c
dd = b*d
m = aa
if(m<bb):
	m = bb
if(m<cc):
	m = cc
if(m<dd):
	m = dd
print(m)

Submission status: Runtime Error

Solution code:
x = map(int,input().split())
list1 = list(x)
list2 = list(range(list1[0],list1[1]+1 ))
list3 = list(range(list1[2],list1[3]+1 ))
list4 = []
for i in list2:
  for l in list3:
      list4_a = list4.append(l*i)
a = max(list4)
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = map(int,input().split())
list1 = list(x)
list2 = list(range(list1[0],list1[1]+1 ))
list3 = list(range(list1[2],list1[3]+1 ))
list4 = []
for i in list2:
  for l in list3:
      list4_a = list4.append(l*i)

print(max(list4))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
e = []
for i in list[a, b]:
    for j in list[c, d]:
        e += [i * j]

print(max(e))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = -10**9


if a <= b:
    if 0 < b <= d:
        ans1 = b*d
    if a <= c < 0:
        ans2 = a*c
    print(max(ans1,ans2))
    if ans != -10**9:
        exit()
    for x in range(a,b+1):
        for y in range(c,d+1):
            product = x * y
            ans = max(ans,product)
if a > b:
    if 0 <= c <= d:
        print(c*d)
    if a < b < 0 :
        print(a*b)
    print(max(ans1,ans2))
    if ans != -10**9:
        exit()
    for x in range(a,c+1):
        for y in range(b,d+1):
            product = x*y
            ans = max(ans,product)
print(ans)

Submission status: Runtime Error

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

ans = -10**9


if a <= b:
    if 0 < b <= d:
        ans1 = b*d
    if a <= c < 0:
        ans2 = a*c
    print(max(ans1,ans2))
    if ans != -10**9:
        exit()
    for x in range(a,b+1):
        for y in range(c,d+1):
            product = x * y
            ans = max(ans,product)
if a > b:
    if 0 <= c <= d:
        print(c*d)
    if a < b < 0 :
        print(a*b)
    print(max(ans1,ans2))
    if ans != -10**9:
    exit()
    for x in range(a,c+1):
        for y in range(b,d+1):
            product = x*y
            ans = max(ans,product)
print(ans)

Submission status: Runtime Error

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

x = range(a,b+1)
y = range(c,d+1)

X = list(x)
Y = list(y)

max = X[0] * Y[0]

for i in range(1, len(X)):
	for j in range(1, len(Y)):
		if max < X[i] * Y[j]:
			max = X[i] * Y[j]
print(max)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
- - - - 
0 2
- + - -
0 2
- - - +
0 2

+ + - -
1 3

+ + + -
1 2
- - + +
1 2

+ + + +
1 3


+ - - -
+ - + -
- - + -

Submission status: Runtime Error

Solution code:
x = map(int,input().split())
list1 = list(x)
list2 = list(range(list1[0],list1[1] ))
list3 = list(range(list1[2],list1[3] ))
list4 = []
for i in list1:
  for l in list2:
      list4_a = list4.append(l*i)

print(max(list4))

Submission status: Runtime Error

Solution code:
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]
mat = np.array([])
for i in [a,b]:
    for j in [c,d]:
        mat = np.append(mat, i*j)
print(int(np.max(mat)))

Submission status: Runtime Error

Solution code:
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]
mat = np.array([])
for i in [a,b]:
    for j in [c,d]:
        mat = np.append(mat, i*j)
print(np.max(mat))

Submission status: Runtime Error

Solution code:
if a>=0 and c>=0:
    one=b
    two=d

elif b<=0 and d<=0:
    one=a
    two=c

elif a>=0 and d<=0:
    one=a
    two=d
elif b<=0 and c>=0:
    one=b
    two=c
else:
    one=b
    two=d


print(one*two)

Submission status: Runtime Error

Solution code:

a=int(input())/10000000
b=int(input())/10000000
c=int(input())/10000000
d=int(input())/10000000

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

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
l = [a,b,c,d]
if (all(i >= 0 for i in l)):
	if a >= b:
		x = a
	else:
		x = b
	if c >= d:
		y = c
	else:
		y = d
elif ((a>=0 and b>=0) and (c<=0 and d<=0)):
	if a >= b:
		x = b
	else:
		x = a
	if c >= d:
		y = c
	else:
		y = d
elif (all(i <= 0 for i in l)):
	if a >= b:
		x = b
	else:
		x = a
	if c >= d:
		y = d
	else:
		y = c
print(x * y)

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split()))
if a>=0 and c>=0:
    one=b
    two=d

elif b<=0 and d<=0:
    one=a
    two=c

elif a>=0 and d<=0:
    one=a
    two=d
elif b<=0 and c>=0:
    one=b
    two=c


print(one*two)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
l = [a,b,c,d]
if (all(i >= 0 for i in l)):
	if a >= b:
		x = a
	else:
		x = b
	if c >= d:
		y = c
	else:
		y = d
elif ((a>=0 and b>=0) and (c<=0 and d<=0)):
	if a >= b:
		x = b
	else:
		x = a
	if c >= d:
		y = c
	else:
		y = d
elif ((a<= 0 and b<=0) and (c<=0 and d<=0)):
	if a >= b:
		x = b
	else:
		x = a
	if c >= d:
		y = d
	else:
		y = c
print(x * y)

Submission status: Runtime Error

Solution code:

a=int(input())
b=int(input())
c=int(input())
d=int(input())

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

Submission status: Runtime Error

Solution code:
a,b,c,d=list(map(int,input().split()))
if a>=0 and c>=0:
    one=b
    two=d

elif b<0 and d<0:
    one=a
    two=c

elif a>=0 and d<0:
    one=a
    two=d
elif b<0 and c>=0:
    one=b
    two=c


print(one*two)

Submission status: Runtime Error

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

if (li[0] or li[1])>0:
  if (li[2] or li[3])>0:
    x=min(li[0],li[1]+1)
    y=max(li[2],li[3]+1)
    print(x*y)
  else:
    x=max(li[0],li[1]+1)
    y=max(li[2],li[3]+1)
    print(x*y)
else:
  if (li[2] or li[3])>0:
    x=mix(li[0],li[1]+1)
    y=man(li[2],li[3]+1)
    print(x*y)
  else:
    x=min(li[0],li[1]+1)
    y=min(li[2],li[3]+1)
    print(x*y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
products = np.zeros(6)
products[0] = a * b
products[1] = a * c
products[2] = a * d
products[3] = b * c
products[4] = b * d
products[5] = c * d
print(int(np.max(products))

Submission status: Runtime Error

Solution code:
import math
input_num = list(map(int, input().split()))
max_num= -math.inf

def seki(x,y):
  return x*y

x= list(range(input_num[0],input_num[1]+1))

for i in x:
  if i>=0:
    result =seki(i,input_num[3])
  else:
    result=seki(i,input_num[2])
  if max_num< result:
      max_num=result
print(max_num)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
maxValue = 999999999999999999999999999
for x in range(a,b):
  for y in range(c,d):
    if x*y < maxValue:
      maxValue=x*y
    else:
      continue 
      
print(maxValue)

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split)
xmx = max([a, b])
xmin = min([a, b])
#xabsmx = max([a, b], key = abs)
#xabsmin = min([a, b],key = abs)
ymx = max([c, d])
ymin = min([c, d])
#yabsmx = max([c,d], key = abs)
#yabsmin = min([c, d],key = abs)
if xmin >= 0:#all X plus
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

if xmx <= 0:#all X minas
    if ymin >= 0:#all Y plus
        print(xmx * ymin)
    else:
        print(xmin * ymin)
else:#X plus and minas
    if ymx <= 0:#all Y minas
        print(xmin * ymx)
    else:
        print(xmx * ymx)

Submission status: Runtime Error

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

if a*b=0 or c*d=0:
    print(0)
elif a*b<=0 and c*d<=0:
    if a*c > b*d:
        print(a*c)
    else:
        print(b*d)
    # print("-+-+")
elif b*d>=0:
    # print("b:d>0")
    print(b*d)
elif b<0:
    # print("b<0")
    print(b*c)
else:
    # print("b>0")
    print(a*d)

Submission status: Runtime Error

Solution code:
import math
input_num = list(map(int, input().split()))
max_num = -math.inf


def seki(x, y):
    return x*y


x = list(range(input_num[0], input_num[1]+1))
y = list(range(input_num[2], input_num[3]+1))

for i in x:
    if i >= 0:
        result = seki(i, input_num[3])
    else:
        result = seki(i, input_num[2])
    if max_num < result:
        max_num = result
print(max_num)

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
max_a = -10**30
import itertools
for i in itertools.combinations(a,2) :
    #print(i[0]*i[1])
    if( i[0]*i[1] > max_a):
        max_a = i[0]*i[i]

print(max_a)

Submission status: Runtime Error

Solution code:
import numpy as np
num = list(map(int, input().split()))
a,b,c,d = num[0],num[1],num[2],num[3]

mat = np.array([])
for i in np.arange(a,b+1):
    for j in np.arange(c,d+1):
        mat = np.append(mat, i*j)
        
print(int(np.max(mat)))

Submission status: Runtime Error

Solution code:
import numpy as np

e=np.empty(4)

a=int(input())
b=int(input())
c=int(input())
d=int(input())

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

print(int(max(e)))

Submission status: Runtime Error

Solution code:
lst = map(int, input().split())
x_lst = []
y_lst = []
max_lst = []
for i in range(2):
  x_lst.append(lst[i])
  y_lst.append(lst[(i+1)*-1])
for j in range(len(x_lst)):
  for k in range(len(y_lst)):
    max_lst.append(x_lst[j] * y_lst[k])
print(max(max_lst))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

  for x in range(a, b + 1):
    for y in range(c, d + 1):
      z.append(x * y)
print(max(z))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
x_num = b - a + 1
y_num = d - c + 1
x_list = np.arange(a, b + 1)
y_list = np.arange(c, d + 1)
ans = x_list[0] * y_list[0]
for i in range(x_num):
    for j in range(y_num):
        ans_temp = x_list[i] * y_list[j]
        if ans < ans_temp:
            ans = ans_temp
answer = ans
print(answer)

Submission status: Runtime Error

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

if a < 0:
    a = -a
if b < 0:
    b = -b
if c < 0:
    c = -c
if d < 0:
    d = -d

if a <= b:
    x = b
if c <= d:
    y = d

print(x*y)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":

    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())

    if b <= 0 :
        if d <= 0:
            xy = a * c
        elif d > 0:
            if c > 0:
                xy = b * c
            elif c == 0:
                xy = 0
            elif c < 0:
                xy = a * c
    elif b > 0:
        if a >= 0:
            if d <= 0:
                xy = a * d
            elif d > 0:
                xy = b * d
        elif a < 0:
            if d <= 0:
                xy = a * c
            elif d > 0:
                if c >= 0:
                    xy = b * d
                elif c < 0:
                    if abs(a * c) > abs(b * d):
                        xy = a * c
                    else:
                        xy = b * d

    print(xy)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
x_lst = [a, b]
y_lst = [c,d]
max_lst = []
for i in range(len(x_lst)):
  for j in range(len(y_lst)):
    max_lst.append(x_lst[i] * y_lst[j])
print(max(max_lst))

Submission status: Runtime Error

Solution code:
a,b,c,d=(int(x) for x in input().split())
print(max[ac,ad,bc,bd])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
if __name__ == "__main__":
    a, b, c, d=(int(x) for x in input().split())
    arr = [a*c, a*d, b*c, b*d]
    print(arr.max())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
lst = []
x_lst = []
y_lst = []
max_lst = []
lst.append(input())
for x in range(2):
    x_lst.append(int(lst[x]))
    y_lst.append(int(lst[(x+1) * -1])
for i in range(len(x_lst)):
    for j in range(len(y_lst)):
        max_lst.append(x_lst[i] * y_lst[j])
print(max(max_lst))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
i = list(map(int, input().split()))
max_num= -math.inf

def seki(x,y):
  return x*y

x= list(range(i[0],i[1]+1))
y= list(range(i[2],i[3]+1))

for i in x:
  for j in y:
    result =seki(i,j)
    if max_num< result:
      max_num=result

print(max_num)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if a>0 and c>0:
  l=list(range(a,b+1))
  m=list(range(c,d+1))
  p=max(l)
  q=max(m)
  c=p*q
elif a>0 and c<0:
  l=list(range(d,c+1,-1))
  m=list(range(a,b+1))
  p=max(l)
  q=min(m)
  c=p*q
elif a<0 and c<0:
  l=list(range(b,a-1,-1))
  m=list(range(d,c-1,-1))
  p=min(l)
  q=min(m)
  c=p*q
print(c)

Submission status: Runtime Error

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

tmp = 0
if(len(a) != 4):
    exit()
if(a[0] > a[1]):
    tmp = a[1]
    a[1] = a[0]
    a[0] = tmp

if(a[2] > a[3]):
    tmp = a[3]
    a[3] = a[2]
    a[2] = tmp
a_len = list(range((a[0]), a[1] + 1))
b_len = list(range((a[2]), a[3] + 1))

max = -100000
print(a_len, b_len)
for str1 in a_len:
    for str2 in b_len:
        if(str1 * str2 > max):
            max = str1 * str2
print(max)

Submission status: Runtime Error

Solution code:
nums = [int(x) for x in input().split()]

sign = [1] * 4
for x in range(4):
    if nums[x] < 0:
        sign[x] = 0

result = min(nums[0:2]) * min(nums[2:])

if sum(sign) == 1:
    result = max(a[0:2]) * max(a[2:])

if sum(sign) == 2:
    if (sign[0] == 1 and sign[1]) or (sign[2] == 1 and sign[3] == 1):
        if sign[0] == 1:
             result = max(nums[0:2]) * min(nums[2:])
        elif sign[2] == 0:
             result = min(nums[0:2]) * max(nums[2:])

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
a,b,c,d = input().split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
abi=int(min(a,b))
abm=int(max(a,b))
cdi=int(min(c,d))
cdm=int(max(c,d))
res1=[]
res2=[]
if abi<0 and abm<0:
  res1=[abi,abm]
elif abi<0 and abm==0:
  res1=[abi,-1,0]
elif abi<0 and abm>0:
  res1=[abi,-1,0,1,abm]
elif abi==0 and abm==0:
  res1=[0]
elif abi==0 and abm>0:
  res1=[0,1,abm]
elif abi>0 and abm>0:
  res1=[abi,abm]

if cdi<0 and cdm<0:
  res2=[cdi,cdm]
elif cdi<0 and cdm==0:
  res2=[cdi,-1,0]
elif cdi<0 and cdm>0:
  res1=[cdi,-1,0,1,cdm]
elif cdi==0 and cdm==0:
  res2=[0]
elif cdi==0 and cdm>0:
  res2=[0,1,cdm]
elif cdi>0 and cdm>0:
  res2=[cdi,cdm]

res=[]
for g in res1:
  for h in res2:
    res.append(g*h)
#print(res)
print(max(res))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

tmp = 0
if(a[0] > a[1]):
    tmp = a[0]
    a[0] = a[1]
    a[1] = tmp

if(a[2] > a[3]):
    tmp = a[3]
    a[3] = a[2]
    a[2] = tmp
a_len = list(range((a[0]), a[1] + 1))
b_len = list(range((a[2]), a[3] + 1))

max = -100000
print(a_len, b_len)
for str1 in a_len:
    for str2 in b_len:
        if(str1 * str2 > max):
            max = str1 * str2
print(max)

Submission status: Runtime Error

Solution code:
li = input().split()
# li  = [3,5,-4,-2]
li1 = li[0:2]
li2 = li[2:4]
ans = -99999999999

for x in li1:
    for y in li2:
        if x*y > ans:
            ans = x*y
print(ans)

Submission status: Runtime Error

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

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: Runtime Error

Solution code:
import numpy as np
a, b, c, d = map(int, input().split())
x_num = b - a + 1
y_num = d - c + 1
ans_matrix = np.zeros([x_num, y_num]) 
x_list = np.arange(a, b + 1)
y_list = np.arange(c, d + 1)
for i in range(x_num):
    for j in range(y_num):
        ans_matrix[i, j] = x_list[i] * y_list[j]

print(int(np.max(ans_matrix)))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if a == 0:
    a = b
if b == 0:
    b = a
if c == 0:
    c = d
if d == 0:
    d = c

if max(a, b) < 0 and max(c, d) > 0:
    A = -min(abs(a), abs(b))
    B = min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) < 0:
    A = min(abs(a), abs(b))
    B = -min(abs(c), abs(d))
elif max(a, b) > 0 and max(c, d) > 0:
    A = max(abs(a), abas(b))
    B = max(abs(c), abs(d))
else:
    A = min(abs(a), abs(b))
    B = min(abs(c), abs(d))

print(A * B)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if p>=0 and q>=0:
  l=list(range(a,b+1))
  m=list(range(c,d+1))
  p=max(l)
  q=max(m)
  c=p*q
elif a>0 and c<0:
  l=list(range(d,c+1,-1))
  m=list(range(a,b+1))
  p=max(l)
  q=max(m)
  c=p*q
elif a<0 and c<0:
  l=list(range(b,a,-1))
  m=list(range(d,c-1))
  p=min(l)
  q=min(m)
  c=p*q
print(c)

Submission status: Runtime Error

Solution code:
ans = -(10**9)
ans = max(a*c, ans)
ans = max(a*d, ans)
ans = max(b*c, ans)
ans = max(b*d, ans)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

x = n*(n-1)*2*(10**(n-2))

print(x%(10**9 + 7))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
aa = a*c
bb = a*d
cc = b*c
dd = b*d
m = aa
if(m<bb):
	m = bb
if(m<cc):
	m = cc
if(m<dd):
	m = dd
print(m)