Bichrome Cells

AtCoder
IDabc074_a
Time2000ms
Memory256MB
Difficulty
We have an $N \times N$ square grid. We will paint each square in the grid either black or white. If we paint exactly $A$ squares white, how many squares will be painted black? ## Constraints * $1 \leq N \leq 100$ * $0 \leq A \leq N^2$ ## Inputs Input is given from Standard Input in the following format: $N$ $A$ [samples]
Samples
Input #1
3
4
Output #1
5

There are nine squares in a $3 \times 3$ square grid. Four of them will be painted white, so the remaining five squares will be painted black.
Input #2
19
100
Output #2
261
Input #3
10
0
Output #3
100

As zero squares will be painted white, all the squares will be painted black.
API Response (JSON)
{
  "problem": {
    "name": "Bichrome Cells",
    "description": {
      "content": "We have an $N \\times N$ square grid. We will paint each square in the grid either black or white. If we paint exactly $A$ squares white, how many squares will be painted black?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc074_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We have an $N \\times N$ square grid.\nWe will paint each square in the grid either black or white.\nIf we paint exactly $A$ squares white, how many squares will be painted black?\n\n## Constraints\n\n*   $1...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments