P2807 Triangle Counting

Background

Triangle counting (triangle), recurrence.

Description

Divide each side of the large triangle into $n$ equal parts. Connect the corresponding division points, with the connecting lines respectively parallel to the three sides. How many triangles are there in total? Write a program to solve this problem.

Input Format

The first line contains an integer $t$ ($t \le 100$), indicating the number of test cases. The next $t$ lines each contain a positive integer $n$ ($n \le 500$).

Output Format

For each $n$, output a single positive integer, representing the number of triangles.

Explanation/Hint

Translated by ChatGPT 5