100740: [AtCoder]ABC074 A - Bichrome Cells

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $100$ points

Problem Statement

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$

Outputs

Print the number of squares that will be painted black.


Sample Input 1

3
4

Sample 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.


Sample Input 2

19
100

Sample Output 2

261

Sample Input 3

10
0

Sample Output 3

100

As zero squares will be painted white, all the squares will be painted black.

Input

题意翻译

我们有一个N*N的矩阵,每个格子可以填上黑或白的一种颜色,如果有a个格子被涂成某种颜色,那么有几个格子涂成了另一种颜色? 输入两行,每行一个整数,表示N,A。 输出一行,一个整数,表示答案 数据范围,1<=N<=100,0<=A<=N*N 感谢@yyhhenry 提供的翻译

加入题单

算法标签: