Determinant

AtCoder
IDabc184_a
Time2000ms
Memory256MB
Difficulty
Given is a $2 \times 2$ matrix $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$. The determinant of $A$ can be found as $ad-bc$. Find it. ## Constraints * All values in input are integers. * $-100 \le a, b, c, d \le 100$ ## Input Input is given from Standard Input in the following format: $a$ $b$ $c$ $d$ [samples]
Samples
Input #1
1 2
3 4
Output #1
\-2

The determinant of $\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$ is $1 \times 4 - 2 \times 3 = -2$.
Input #2
0 -1
1 0
Output #2
1
Input #3
100 100
100 100
Output #3
0
API Response (JSON)
{
  "problem": {
    "name": "Determinant",
    "description": {
      "content": "Given is a $2 \\times 2$ matrix $A = \\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}$.   The determinant of $A$ can be found as $ad-bc$.   Find it.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc184_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is a $2 \\times 2$ matrix $A = \\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}$.  \nThe determinant of $A$ can be found as $ad-bc$.  \nFind it.\n\n## Constraints\n\n*   All values in input are integers.\n*...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments