#C8519. Glass Cube Pyramid
Glass Cube Pyramid
Glass Cube Pyramid
You are given an integer (n) which represents the side length of the base layer in a pyramid made of glass cubes. The pyramid is constructed in such a way that the bottom layer consists of (n^2) cubes, the next layer consists of ((n-1)^2) cubes, and so on until the top layer which consists of (1^2) cube. The total number of cubes in the pyramid is given by the sum of squares:
[ \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} ]
Your task is to compute and output the total number of cubes in the pyramid.
inputFormat
The input consists of a single integer (n) ((1 \leq n \leq 10^4)), which is the side length of the base layer.
outputFormat
Output a single integer which is the total number of cubes in the pyramid.## sample
1
1