Problem:


Score : 200 points

Problem Statement

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

Constraints

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

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

All values in input are integers.

Input

Input is given from Standard Input in the following format:

a b c d

Output

Print the answer.

Sample Input 1

1 2 1 1

Sample Output 1

2

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

Sample Input 2

3 5 -4 -2

Sample Output 2

-6

The answer can be negative.

Sample Input 3

-1000000000 0 -1000000000 0

Sample Output 3

1000000000000000000



Sample input:
1 2 1 1


Sample output:
2

Submission status: Accepted

Solution code:
def LI():return list(map(int,input().split()))
def II():return int(input())
def yes():return print("Yes")
def no():return print("No")
INF=float("inf")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
from itertools import product, combinations
from functools import reduce, lru_cache
from math import pi, gcd
from decimal import Decimal

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

class Unionfind:
    def __init__(self, N):
        self.p = list(range(N))
        self.rank = [0] * N
        self.size = [1] * N

    def root(self, x):
        if self.p[x] != x:
            self.p[x] = self.root(self.p[x])

        return self.p[x]

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        u = self.root(x)
        v = self.root(y)

        if u == v: return

        if self.rank[u] < self.rank[v]:
            self.p[u] = v
            self.size[v] += self.size[u]
            self.size[u] = 0
        else:
            self.p[v] = u
            self.size[u] += self.size[v]
            self.size[v] = 0

            if self.rank[u] == self.rank[v]:
                self.rank[u] += 1

    def count(self, x):
        return self.size[self.root(x)]


a,b,c,d=LI()

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

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:
# URL : https://atcoder.jp/contests/abc178/tasks/abc178_b

def Yes(f): print('Yes' if f else 'No')
def YES(f): print('YES' if f else 'NO')
def ispow(x): return int(x ** 0.5) ** 2 == x


res = -float('inf')
# n = int(input())
# a, b = map(int, input().split())
# a, b, c = map(int, input().split())
a, b, c, d = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7

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

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

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

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


# print('Yes' if main() else 'No')
print(main())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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())
max = a*c

if max > bd:
  print(max)
else:
  print(bd)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_line = input()
x = input_line.split()
a = x[0]
b = x[1]
c = x[2]
d = x[3]

xy1 = a*c
xy2 = a*d
xy3 = b*c
xy4 = b*d

print(max([xy1, xy2, xy3, xy4]))

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

print(max(ab, ac, ad, bc, bd. cd))

Submission status: Runtime Error

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

if a >= 0 and b >= 0 and c >= 0 and d >= 0:
  answer = b*d

elif a <0 and b<0 and c <0 and d <0:
  answer = a*c

elif a < 0 and c < 0 and b >= 0 and d >= 0:
  temp1 = -a
  temp2 = -c
  temp3 = max(temp1,b)
  temp4 = max(temp2,d)
  answer = temp3*temp4

print(answer)

Submission status: Runtime Error

Solution code:
n=int(input())
mod=10**9+7
dp=[0]*2001
dp[0]=1
sdp=[0]*2001
sdp[0]=1
for i in range(2000):
  dp[i+1]=sdp[i-2]
  sdp[i+1]=dp[i+1]+sdp[i]
print(dp[n]%mod)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())

X=[]
Y=[]
for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)
A="NO"
for n in range(N-2):
    if X[n]==Y[n] and X[n+1]==Y[n+1] and X[n+2]==Y[n+2]:
        A="YES"
        break
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:
a=int(input("a="))
b=int(input("b="))
c=int(input("c="))
d=int(input("d="))
X=max(a*c,a*d)
X=max(X,b*c)
X=max((X,b*d))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

vetor = [a*c, a*d, b*c, b*d]
print(max(vetor, key=int))

Submission status: Runtime Error

Solution code:
a,b,c,d,x,y = int(input())
if a<= x <= b and c <= y <= d:
 print(b*d)

Submission status: Runtime Error

Solution code:
a,b,c,d,x,y = int(input())
if a<= x <= b and c <= y <= d:
 print((b-1)*(d-1))

Submission status: Runtime Error

Solution code:
a,b,c,d,x,y = int(input())
if a<= x <= b and c <= y <= d:
 print(x*y)

Submission status: Runtime Error

Solution code:
def get_ints() :
  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: Runtime Error

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

Submission status: Runtime Error

Solution code:
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        System.out.println( Math.max( (Math.max(a*c,a*d)),(Math.max(b*c,b*d)) ) );



    }
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
    import numpy as np
  	l = 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: Runtime Error

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

Submission status: Runtime Error

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

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

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

if f>g:
  if h>f:
    if i>h:
      print(i)
    else:
      print(h)
  else:
    if i>f:
      print(i)
    else:
      print(f)
else:
  if h>g:
    if i>h:
      print(i)
    else:
      print(h)
  else:
    if i>g:
      print(i)
    else:
      print(g)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
line[n]
x=int(line[1])
y=int(line[3])
print(x*y)

Submission status: Runtime Error

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 and b>0) or (c<0 and d>0))):
    print(0)
  elif(a>0 and b>0):
    print(d*a)
  elif(c>0 and d>0):
    print(b*ChildProcessError)
else:
  print(b*d)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
x=input().rstrip.split(" ")
z=[]
for i in range(2):
	z.append(x[i-2]*x[0])
    z.append(x[i-2]*x[1])
print(max(z))

Submission status: Runtime Error

Solution code:
x=input().rstrip.split(" ")
z=[]
for i in range(2):
	for y in range(2):
      z.append(x[i-2]*x[y-2])
print(max(z))

Submission status: Runtime Error

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


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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
//                               //
    // author : samars_diary //
    // 16-09-2020 │ 18:15:57 //
//                               //

#include <iostream>
using namespace std;

void solve(){
    long long int a,b,c,d;
    cin>>a>>b>>c>>d;
    long long int p = max(max(a,b)*max(c,d),min(a,b)*min(c,d));
    long long int q= max(min(a,b)*max(c,d),max(a,b)*min(c,d));
    cout<<max(p,q);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    int t = 1;
    while(t--){
        solve();
    }

    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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=0
 
#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: Runtime Error

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

num_listx = []
num_listy = []

for num in range(a,b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(c,d + 1):
  if nums >= c:
    num_listy.append(nums)
find_max = []
for i in range(len(num_listx)):
  find_max.append(num_listx[i] * num_listy[i])
print(max(find_max))

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(a,b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(c,d + 1):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(d + 1):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
find_max = []
for i in range(len(num_listx)):
  find_max.append(num_listx[i] * num_listy[i])
print(max(find_max))

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a and <= b:
    num_listx.append(num)
for nums in range(d):
  if nums >= c and <= d:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
    
print(max(num_listx) * max(num_listy))

Submission status: Runtime Error

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a and <= b:
    num_listx.append(num)
for nums in range(d):
  if nums >= c and <= d:
    num_listy.append(nums)
    
print(max(num_listx) * max(num_listy))

Submission status: Runtime Error

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

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

print(max(l))

Submission status: Runtime Error

Solution code:
n = int(input())
print(10**n-9**n-8**n-9**n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0

numl = list(a,b)
numl2 = list(c,d)


for i in range(2):
    for j in range(2):
        zyou = numl[i] * numl2[j]
        if ans < zyou:
            ans = zyou

print(ans)

Submission status: Runtime Error

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

ans = 0

numl = list(a,b)
numl2 = list(c,d)


for i in range(2):
    for j in range(2):
        zyou = numl[i] * numl2[j]
        if ans < zyou:
            ans = zyou

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = a*b
f = a*c
g = b*c 
h = b*d
li = []
li.append(e)
li.append(f)
li.append(g)
li.append(h)
li.sort()
print(li[3])

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

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

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

Submission status: Runtime Error

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

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

che = list(ac,ad,bc,bd)

ans = 0

for i in range(4):
  if ans < che[i]:
    ans = che[i]

print(ans)

Submission status: Runtime Error

Solution code:
def main():
    INP = list(map(int, input().split()))
    list1 = [INP[0],INP[1]]
    list2 = [INP[2],INP[3]]
    if INP[0] < 0 and INP[1] > 0:
        list1.append([-1,0,1])
    if INP[2] < 0 and INP[3] > 0:
        list2.append([-1,0,1])
    ans = -(10**18)
    for item in list1:
        for item2 in list2:
            ans = max(ans,item*item2)
    print(ans)       


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

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

print(max(int(ans)))

Submission status: Runtime Error

Solution code:
-1000000000 0 -1000000000 0

Submission status: Runtime Error

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

Submission status: Runtime Error

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

results = []
for i in (0, 1):
  for j in (2, 3):
    results.append(inputs[i] * inputs[j])

print(max(results))

Submission status: Runtime Error

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

results = []
for i in (0, 1):
  for j in (2, 3):
    reults.append(inputs[i] * inputs[j])

print(max(results))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(max(int(x)*int(y)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
ans = -float("INF")

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv
a = args[1]
b = args[2]
c = args[3]
d = args[4]

aa = int(a)*int(c)
bb = int(a)*int(d)
cc = int(b)*int(c)
dd = int(b)*int(d)

li = [aa,bb,cc,dd]

print(max(li))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
    if __name__ == '__main__':
        x = [list(map(int, input().split())) for i in range(1)]
     
        a = int(x[0][0])
        b = int(x[0][1])
        c = int(x[0][2])
        d = int(x[0][3])
     
        x = range(a, a + abs(a - b) + 1)
        y = range(c, c + abs(c - d) + 1)
     
        ans = -1000000000
     
        for n in x:
            for m in y:
                if ans < n * m:
                    ans = n * m
     
        print(ans)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,d;
cin >>a >>b >>c >>d;
long long x,y;
x = max(a*c , b*d);
y = max(a*d, b*c);
x = max(x,y);
cout <<x;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())
i = 0
for x in range(a, b+1):
  for y in range(c, c+1):
    x * y = z
    if z >= i:
      i = z
print(i)

Submission status: Runtime Error

Solution code:
a,b,c,d = int(input(),split())
ans = -float("inf")
xrange = range(a,b+1)
yrange = range(c,d+1)
for x in xrange:
  for y in yrange:
    if x*y > ans:
      ans = x*y

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;
//debug 
#ifdef _DEBUG
#define debug(var)  do{cout << #var << " :";view(var);}while(0)
#else
#define debug(...)
#endif
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }


int main(){
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  ll ans = max({a*c,a*d,b*c,b*d});
  cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
values = [a*c, a*d, b*c, b*d]
print(max(values))

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

Submission status: Runtime Error

Solution code:
in = input()
a,b,c,d = map(int,in)
output = []
for t in range(a,b+1):
  for p in range(c,d+1):
    output.append(t*p)
print(max(output))

Submission status: Runtime Error

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

if a>0:
    if d>0:
        print(bd)
    else:
        print(ad)
elif b<0:
    if c<0:
        print(ac)
    else:
        print(bc)
else:
    if d>0:
        print(bd)
    else:
        print(ac)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
INF = 10 ** 9
y_min_pos = [INF, []]
x_min_pos = [INF, []]
y_max_pos = [0, []]
x_max_pos = [0, []]
for _ in range(N):
    # print(x_min_pos, y_min_pos, y_max_pos, x_max_pos)
    x, y = map(int, input().split())
    if y <= y_min_pos[0]:
        if y == y_min_pos[0]:
            y_min_pos[1].append(x)
        else:
            y_min_pos = [y, [x]]
    if y >= y_max_pos[0]:
        if y == y_max_pos[0]:
            y_max_pos[1].append(x)
        else:
            y_max_pos = [y, [x]]

    if x <= x_min_pos[0]:
        if x == x_min_pos[0]:
            x_min_pos[1].append(y)
        else:
            x_min_pos = [x, [y]]
    if x >= x_max_pos[0]:
        if x == x_max_pos[0]:
            x_max_pos[1].append(y)
        else:
            x_max_pos = [x, [y]]
# print(x_max_pos[1])
x_min_ymax = max(x_min_pos[1])
x_max_ymax = max(x_max_pos[1])
y_min_xmax = max(y_min_pos[1])
y_max_xmax = max(y_max_pos[1])
x_min_ymin = min(x_min_pos[1])
x_max_ymin = min(x_max_pos[1])
y_min_xmin = min(y_min_pos[1])
y_max_xmin = min(y_max_pos[1])

y_min_max = max(
    abs(y_min_xmax - x_min_pos[0]) + abs(y_min_pos[0] - x_min_ymax),
    abs(y_min_xmax - y_max_xmin) + abs(y_min_pos[0] - y_max_pos[0]),
    abs(y_min_xmin - x_max_pos[0]) + abs(y_min_pos[0] - x_max_ymax),
    abs(y_min_xmin - y_max_xmax) + abs(y_min_pos[0] - y_max_pos[0]),
)
y_max_max = max(
    abs(y_max_xmax - x_min_pos[0]) + abs(y_max_pos[0] - x_min_ymin),
    abs(y_max_xmax - y_min_xmin) + abs(y_max_pos[0] - y_min_pos[0]),
    abs(y_max_xmin - x_max_pos[0]) + abs(y_max_pos[0] - x_max_ymin),
    abs(y_max_xmin - y_max_xmax) + abs(y_max_pos[0] - y_min_pos[0]),
)
x_min_max = max(
    abs(x_min_ymax - y_min_pos[0]) + abs(x_min_pos[0] - y_min_xmax),
    abs(x_min_ymax - x_max_ymin) + abs(x_min_pos[0] - x_max_pos[0]),
    abs(x_min_ymin - y_max_pos[0]) + abs(x_min_pos[0] - y_max_xmax),
    abs(x_min_ymin - x_max_ymax) + abs(x_min_pos[0] - x_max_pos[0]),
)
x_max_max = max(
    abs(x_max_ymax - y_min_pos[0]) + abs(x_max_pos[0] - y_min_xmin),
    abs(x_max_ymax - x_min_ymin) + abs(x_max_pos[0] - x_min_pos[0]),
    abs(x_max_ymin - y_max_pos[0]) + abs(x_max_pos[0] - y_max_xmin),
    abs(x_max_ymin - x_min_ymax) + abs(x_max_pos[0] - x_min_pos[0]),
)
print(max(y_min_max, y_max_max, x_min_max, x_max_max))

Submission status: Runtime Error

Solution code:
ans=-10**18
if a<=0<=b or c<=0<=d:
  ans=0
ans=max(ans,a*c,a*d,b*c,b*d)
print(ans)

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

Submission status: Runtime Error

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

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:
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

const int MOD = 1000000007;

// vector<vector<int>> data(3, vector<int>(4));

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll a, b, c, d;
  cin >> a >> b >> c >> d;

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

  printf("%lld", ans);
}

Submission status: Runtime Error

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