Under construction

Still being built. Things may change

Ornaments

Time limit1sMemory limit1024 MB

Summary
Given the number of layers, find the total ornaments in a triangular pyramid where layer k holds k(k+1)/2 balls.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

You work at the local mall and must set up the Christmas ornament display. The display is a triangular pyramid. The top layer has one ball, the second layer from the top has three, and each lower layer has more. The side length of each layer equals its layer number. Write a program that takes the number of layers and finds the total number of ornaments in the pyramid.

Input

The first line contains a single integer n, the number of data sets. Each of the following data sets is one line with one integer, the number of layers in the pyramid.

Output

For each data set, output the total number of ornaments in the pyramid.

Examples1

  1. Example 1

    Input
    2
    1
    4
    
    Expected output
    1
    20