問題概要
問題ページ
-
-
B - Product Max
問題ページへ移動する
問題文
整数 a,b,c,d が与えられます。
a \leq x \leq b, c\leq y \leq d を満たす整数 x,y について、x \times y の最大値はいくつですか。
制約
- -10^9 \leq a \leq b \leq 10^9
- -10^9 \leq c \leq d \leq 10^9
- 入力はすべて整数
問題の考察
ACコード
import sys
def solve():
input = sys.stdin.readline
mod = 10 ** 9 + 7
a, b, c, d = list(map(int, input().rstrip('\n').split()))
print(max(a * c, a * d, b * c, b * d))
if __name__ == '__main__':
solve()