AtCoder Beginner Contest 178
B
Product Max
AtCoder
⌀ 0
原题
← AC →
翻译中…

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.

翻译中…

样例

Input #1
1 2 1 1
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$.
Input #2
3 5 -4 -2
Output #2
-6
The answer can be negative.
Input #3
-1000000000 0 -1000000000 0
Output #3
1000000000000000000
题目信息
题号
abc178_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。