[Solution] Black cells in a chessboard solution codechef

Black cells in a chessboard solution codechef


Given nn (nn is even), determine the number of black cells in an n×nn×n chessboard.

Input Format Black cells in a chessboard solution codechef

The only line of the input contains a single integer nn.

Output Format Black cells in a chessboard solution codechef

Output the number of black cells in an n×nn×n chessboard.

Constraints Black cells in a chessboard solution codechef

  • 2n1002≤n≤100
  • nn is even

Sample Input 1 

8

Sample Output 1 

32

Explanation

Black cells in a chessboard solution codechef

There are 3232 black cells and 3232 white cells in an 8×88×8 chessboard. So the answer is 3232.

Solution: Click here

solution codechefcodechef solutioncodechef freshersonline

Leave a Comment