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

Solution in C++ (Clang 10.0.0) (judge verdict: Wrong Answer)

//AUTHOR:- Avinash//
//#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define ll long long int
#define lll long long
#define fo(i,n) for(int i=0;i<n;i++)
#define take(a,i,n) for(int i=0;i<n;i++) cin>>a[i]
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ld long long double
#define d1(x) cout<<(x)<<endl
#define T int t;cin>>t;while(t--)
#define hell 1000000007
#define ex endl;
#define F first
#define maxn 200001
#define pi 3.14159265
#define S second
#define P pair<int,int>
#define PP pair<int,pair<int,int>>
#define pb push_back
#define in insert
#define vec vector<ll>
#define vec2 vector<vector<int>>
#define s(a,n) sort(a,a+n);
#define sv(a) sort(a.begin(),a.end());
#define MAX 1000
//Author:-Avinash//

ll power(ll x, ll y, ll m)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2, m) % m;
    p = (p * p) % m;
    return (y%2 == 0)? p : (x * p) % m;
}
ll sum_of_natural_no(ll n )
{
    return (n *(n+1))/2;
}

ll modInverse(ll a, ll m)
{
    return power(a, m-2, m);
}
int main(){
   FAST
   ll a,b,c,d,n,m;
   cin>>a>>b>>c>>d;
   if(a>0 && b>0 && c>0 && d>0){
    n = b;
    m = d;
   }
   else if(a>0 && b>0 && c<0 && d<0){
    n = a;
    m = d;
   }
   else if(a<0 && b<0 && c>0 && d>0){
    n = b;
    m = d;
   }
   else if(a<0 && b<0 && c<0 && d<0){
    n = b;
    m = d;
   }
   else if( a>0 && b<0 && c>0 && d<0){
    n = a;
    m = c;
   }
   else if( a<0 && b>0 && c<0 && d>0){
    n = b;
    m = d;
   }
   else if( a == 0 && c==0){
       n = b;
       m = d;
   }
   else if(b == 0 && d==0){
       n=a;
       m=c;
   }

cout<<n*m;
    
   return 0;
}