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())
ac = a*c
ad = a*d
bc = b*c
bd = b*d

if ac>ad and ac>bc and ac>bd:
  print(ac)
elif ad >bc and ad>bd and ad>ac:
  print(ad)
elif bc>ac and bc>ad and bc>bd:
  print(bd)
else:
  print(bd)

Submission status: Wrong Answer

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

resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(map(int, input().split()))
n_max = -100
for i in range(0, 2):
    for j in range(2, 4):
        if n_max < n[i] * n[j]:
            n_max = n[i] * n[j]
print(n_max)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

input_ = sys.stdin.readline

a, b, c, d = [int(x) for x in input_().strip().split(" ")]

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

Submission status: Wrong Answer

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

print(x)

Submission status: Wrong Answer

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

if a <= b:
    x = b
if a >= b:
    x = a

if c <= d:
    y = d
if c >= d:
    y = c
print(x*y)

Submission status: Wrong Answer

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

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


print(a, b, c, d)

X1 = min(a,b) * min(c,d)
X2 = min(a,b) * max(c,d)
X3 = max(a,b) * min(c,d)
X4 = max(a,b) * max(c,d)

print(max(X1,X2,X3,X4))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -2e20
for x in [a, b, 0]:
    for y in [c,d, 0]:
        if x * y > ans:
            ans = x * y
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
A =  list(map(int, input().split()))
ans = 0
for i in combinations(A, 2):
    ans = max(i[1]*i[0], ans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-09-13 20:49:18 +0900
# LastModified: 2020-09-13 21:05:17 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

from typing import *



# def solve(a: int, b: int, c: int, d: int) -> int:
def solve(a, b, c, d):
    ans=0
    if b*d<0:
        x=min(abs(a),abs(b))
        y=min(abs(c),abs(d))
        ans=-1*x*y
    else:
        x=max(abs(a),abs(b))
        y=max(abs(c),abs(d))
        ans=x*y
    return ans

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

m = -9999

ac = a * c
if ac >= m:
  m = ac

ad = a * d
if ad > m:
  m = ad

bc = b * c
if bc >= m:
  m = bc

bd = b * d
if bd >= m:
  m = bd

print(m)

Submission status: Wrong Answer

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

max = 0
if  max < a*c:
    max = a*c
elif max < a*d:
    max = a*d
elif max < b*c:
    max = b*c
elif max < b*d:
    max = b*d
print(max)

Submission status: Wrong Answer

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

for i in range(a,b+1):
  l.append(i)
for j in range(c,d+1):
  m.append(j)
  
print(int(max(l)*max(m)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

import sys
input=sys.stdin.readline

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print max(a*c, d*b)

Submission status: Wrong Answer

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

ans = a * b

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    a,b,c,d = map(int,input().split())
    
    ans = -1 * 10**10
    
    for i in (a,b):
        for j in (c,d):
            if i*j > ans:
                ans = i*j
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if b < 0 and d > 0:
    print(b*c)
elif b > 0 and d < 0:
    print(a*d)
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, d*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 d <= 0 and b > 0:
    print(d*a)
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 and c >= 0:
  print(b*c)
elif a >= 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())

x=0
y=0
if b < 0:
  x=b
else:
  x=a

if d < 0:
  y=d
else:
  y=c

print(x*y)

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

print(max(x, y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 10**10
ans = ans * -1    

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
a,b,c,d=I()
print(max(a*c,a*d,b*d,b*d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -2e10
for x in [a, b, 0]:
    for y in [c,d, 0]:
        if x * y > ans:
            ans = x * y
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


print(b*d)

Submission status: Wrong Answer

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

max = 0
if max < a*b:
    max = a*b
elif max < a*c:
    max = a*c
elif max < a*d:
    max = a*d
elif max < b*c:
    max = b*c
elif max < b*d:
    max = b*d
elif max < c*d:
    max = c*d
print(max)

Submission status: Wrong Answer

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# map(int, input().split())
lst = list(map(int, input().split()))
 
max_value = -pow(10,18)
for i in range(len(lst)):
  for j in range(i):
    max_value = max(max_value, lst[i]*lst[j])
 
print(max_value)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
a,b,c,d = map(int,input().split())
m = -1*10**10
m = max(m,a*c)
m = max(m,a*d)
m = max(m,b*c)
m = max(m,b*d)
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -2e10
for x in [a, b]:
    for y in [c,d]:
        if x * y > ans:
            ans = x * y
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(map(int, input().split()))
print(n[1]*n[3])

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

a,b,c,d=MI()
ans=-10**16
ans=max(ans,a*c)
ans=max(ans,a*d)
ans=max(ans,b*c)
ans=max(ans,b*d)
if a<=0<=b or c<=0<=d:
    ans=max(0,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import collections as cc
import math as mt
I=lambda:list(map(int,input().split()))
a,b,c,d=I()
print(max(b*d,a*c,a*d,b*d))

Submission status: Wrong Answer

Solution code:
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# ------------------- fast io --------------------
from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi


def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

def lcm(a, b): return a * b // gcd(a, b)


def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y


for _ in range(int(input()) if not True else 1):
    #n = int(input())
    #n, k = map(int, input().split())
    a, b, c, d = map(int, input().split())
    #c, d = map(int, input().split())
    #a = list(map(int, input().split()))
    #b = list(map(int, input().split()))
    #s = input()
    print(max(a*d, b*d, a*c, a*d))

Submission status: Wrong Answer

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

print(mx)

Submission status: Wrong Answer

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

if b > 0 and d > 0:
  print(b * d)
elif a < 0 and c < 0:
  print(a * c)
else:
  print(-1 * min(abs(a), abs(b)) * min(abs(c), abs(d)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = -10**9

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

print(ans)

Submission status: Wrong Answer

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

mab = max(abs(a), abs(b))
mcd = max(abs(c), abs(d))


print(mab*mcd)

Submission status: Wrong Answer

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

x = max([i for i in range(a,b+1)])
y = max([i for i in range(c,d+1)])

print(x*y)

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
import random


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


def lcm(a, b):
    return (a * b) / gcd(a, b)
a=list(map(int , input().split()))
ans=-1
for i in range(4):
    for j in range(i+1,4):
        if ans==-1:
            ans=a[i]*a[j]
        else:
            ans=max(ans, a[i]*a[j])
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input().split())
X=[a,b]
Y=[c,d]
if a<=0<=b:
    X.append(0)
if c<=0<=d:
    Y.append(0)
ans=-10**15
for x in X:
    for y in Y:
        if ans<x*y:
            ans=x*y
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
a,b,c,d=get_ints()
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())
print(min([a*c,a*d,b*c,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: Time Limit Exceeded

Solution code:
abcd = list(map(int, input().split(" ")))
a = abcd[0]
b = abcd[1]
c = abcd[2]
d = abcd[3]

# print(a, b, c, d)

xVals = []
yVals = []



if (b == d and b == 0):
    print(a*c)
else:
    for i in range(a, b+1, 1):
        # print(i)
        xVals.append(i)
    for j in range(c, d+1, 1):
        # print(j)
        yVals.append(j)

    maxP = xVals[0] * yVals[0]
    for xVal in xVals:
        for yVal in yVals:
            if (xVal * yVal > maxP):
                maxP = xVal * yVal        
    print(maxP)

Submission status: Time Limit Exceeded

Solution code:
a, b, c, d = list(map(int, input().split()))
ad = set()
for i in range(a, b + 1):
    for j in range(c, d + 1):
        ans = i * j
        ad.add(ans)

print(max(ad))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
nlist = list(map(int, input().split()))
top = -float('inf')
for x in range(nlist[0],nlist[1]+1):
  for y in range(nlist[2],nlist[3]+1):
    if x*y>top:
      top = x*y
print(top)

Submission status: Time Limit Exceeded

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

max_pro = -float("inf")
for i in range(a, b + 1):
  for j in range(c, d + 1):
    product = i * j
    if max_pro < product:
      max_pro = product

print(max_pro)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

max = a * c
for i in range(a, b+1):
  for j in range(c, d+1):
    k = i * j
    if k > max:
      max = k
      
print(max)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d = map(int,input().split())
arr = [int(x) for x in range(a,b+1)]
arr2 = [int(x) for x in range(c,d+1)]
ans = arr[0]*arr2[0]
if arr[-1]*arr2[0] > ans:
    ans = arr[-1]*arr2[0]
elif arr[0]*arr2[-1] > ans:
    ans = arr[0]*arr2[-1]
elif arr[-1]*arr2[-1] > ans:
    ans = arr[-1]*arr2[-1]
else:
    pass
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

s = []

for x in range(a,b+1):
  for y in range(c,d+1):
    n = x*y
    s.append(n)

s.sort(reverse = True)
print(s[0])

Submission status: Time Limit Exceeded

Solution code:
class Solution:
	def findMaxProduct(self,a,b,c,d) -> int:
		ans = a*c
		for i in range(a,b+1):
			for j in range(c,d+1):
				if i*j >= ans:
					ans = (i*j)
		return ans

ob = Solution()
a,b,c,d = map(int,input().split())
print(ob.findMaxProduct(a,b,c,d))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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


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

Submission status: Time Limit Exceeded

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

ans=-1e9

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

Submission status: Time Limit Exceeded

Solution code:
nums = [int(num) for num in input().split()]
max = True
for i in range(nums[0], nums[1] + 1):
    for j in range(nums[2], nums[3] + 1):
        if max == True:
            max = i * j
        elif max < i * j:
            max = i * j

print(max)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,c,d = map(int,input().split())
ans = -1000000000
for i in range(b-a+1):
    x = a+i
    for l in range(d-c+1):
        y = c+l
        
        if x*y > ans:
            ans = x*y
            #print(ans)
        else:
            continue

print(ans)

Submission status: Time Limit Exceeded

Solution code:
nums = [int(e) for e in input().split()]
a=nums[0]
b=nums[1]
c=nums[2]
d=nums[3]
i = 0
j = 0
max = a*c
for i in range(a, b+1, 1):
    for j in range(c, d+1, 1):
        if max < i * j:
            max = i * j
print(max)

Submission status: Time Limit Exceeded

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

if max(x) >= 0 and max(y) >= 0:
  print(max(x)*max(y))
elif max(x) >= 0 and max(y) < 0:
  print(min(x) * max(y))
elif max(x) < 0 and max(y) >= 0:
  print(max(x)*min(y))
else :
  print(max(x)*max(y))

Submission status: Time Limit Exceeded

Solution code:
import itertools
a,b,c,d=map(int,input().split())
ans=-10**9

if  b<=0 and d<=0:
    ans=a*c

else :
    x=list(int(x) for x in range(a,b+1))
    y=list(int(y) for y in range(c,d+1))
    l=list(itertools.product(x, y))
    
    for i in range(len(l)):
        if ans<l[i][0]*l[i][1]:
            ans=l[i][0]*l[i][1]

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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