A - Range Product
Editorial
/
Time Limit: 2 sec / Memory Limit: 256 MB
問題文
整数 a,b (a≤b) が与えられます。 a,a+1,...,b すべての積が、正か、負か、0 かを判定してください。
制約
- a,b は整数である。
- -10^9≤a≤b≤10^9
部分点
- 100 点分のデータセットでは、-10≤a≤b≤10 が成り立つ。
入力
入力は以下の形式で標準入力から与えられる。
a b
出力
a,a+1,...,b すべての積が、正ならば Positive
を、負ならば Negative
を、0 ならば Zero
を出力せよ。
入力例1
1 3
出力例1
Positive
1×2×3=6 は正です。
入力例2
-3 -1
出力例2
Negative
(-3)×(-2)×(-1)=-6 は負です。
入力例3
-1 1
出力例3
Zero
(-1)×0×1=0 です。
Problem Statement
You are given two integers a and b (a≤b). Determine if the product of the integers a, a+1, …, b is positive, negative or zero.
Constraints
- a and b are integers.
- -10^9≤a≤b≤10^9
Partial Score
- In test cases worth 100 points, -10≤a≤b≤10.
Input
The input is given from Standard Input in the following format:
a b
Output
If the product is positive, print Positive
. If it is negative, print Negative
. If it is zero, print Zero
.
Sample Input 1
1 3
Sample Output 1
Positive
1×2×3=6 is positive.
Sample Input 2
-3 -1
Sample Output 2
Negative
(-3)×(-2)×(-1)=-6 is negative.
Sample Input 3
-1 1
Sample Output 3
Zero
(-1)×0×1=0.