Range Product

AtCoder
IDagc002_a
Time2000ms
Memory256MB
Difficulty
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$ ## Input The input is given from Standard Input in the following format: $a$ $b$ ## Partial Score * In test cases worth $100$ points, $-10≤a≤b≤10$. [samples]
Samples
Input #1
1 3
Output #1
Positive

$1×2×3=6$ is positive.
Input #2
\-3 -1
Output #2
Negative

$(-3)×(-2)×(-1)=-6$ is negative.
Input #3
\-1 1
Output #3
Zero

$(-1)×0×1=0$.
API Response (JSON)
{
  "problem": {
    "name": "Range Product",
    "description": {
      "content": "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.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc002_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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.\n\n## Constraints\n\n*   $a$ and $b$ are integers.\n*   $-10^9≤a...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments