Problem:
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.

Solution in C (GCC 5.4.1) (judge verdict: Runtime Error)

#include<stdio.h>

int main(void){

  int a_n=0;
  int n[200]={0};
  int flag=0;
  int cnt=0;
  int i=0;
  
  scanf("%d", &a_n);
  
  for(i=0; i<a_n; i++){
    scanf("%d", n + i);
    if(*(n+i)%2!=0) flag=1;
  }
  if(flag==1){
    printf("0\n");
    return 1;
  }
  
  flag=0;
  while(flag==0){
    cnt++;
    for(i=0; i<a_n; i++){
      n[i]=n[i]/2;
      if(n[i]%2==1){
	printf("%d\n", cnt);
	return 1;
      }
    }
  }
  
  printf("%d\n", cnt);;
  
  return 0;
}