#CCBCMCHIN0000049. Dấu của tích không nhân (Sign of a Product Without Multiplication)
Dấu của tích không nhân (Sign of a Product Without Multiplication)
Sign of a Product Without Multiplication
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given two signed 32-bit integers , output whether their mathematical product is zero, positive, or negative. Do not multiply the values.
Input
One line contains signed integers .
Output
Print ZERO for zero, POS for positive, or NEG for negative.
Subtasks
-
Subtask 1 (20 points): Both integers are within [-10,10].
-
Subtask 2 (30 points): Both integers are within [-100000,100000].
-
Subtask 3 (50 points): Both are signed 32-bit integers.
Examples
Example 1
Input
-2147483648 -1
Output
POS
Explanation
For this input, the case-specific computation and the required exact output are shown above. Two negative nonzero factors have a positive product.
Example 2
Input
0 -5
Output
ZERO
Explanation
For this input, the case-specific computation and the required exact output are shown above. A zero factor makes the product zero.