For a recap of part one of the super-popular story, see this recap image.
HINATA AND VOLLEYBALL GRAPH: PART TWO
Consider the following method of decomposing a volleyball into a graph. Assume that a volleyball's surface contains six sections, or faces. Each section will have the same number of panels, or ridges. Denote the number of panels per section as . Edgewise adjacent panels are considered as being connected by an edge. Two panels that have an edge connecting them do not have to be on the same section (face).
For the purposes of this problem: Imagine a volleyball as a cube. Imagine one face facing toward you. Each face is a section. The lines on a section separate it into panels. The panels are horizontal on the face/section closest to you and horizontal on the face/section farthest from you. All other faces/sections have vertical panels.
GUWAA?! Hinata thought. For a –graph, how many edges is that even? 1, 2, … And what if I considered such –graphs? Maybe I should just get some piece of software to solve this for me.
As an up-and-coming volleyball player, Hinata would like to know for volleyballs, each with a given number of panels per section , the number of total edges there are in the corresponding graph of the volleyball as defined above.
Constraints
Subtask 1 [10%]
,
Subtask 2 [10%]
,
Subtask 3 [80%]
,
Input Specification
First line: , the number of test cases.
Next lines: An integer .
Output Specification
lines of output, each with a single integer: The number of edges in the specified –graph, in the same order as the input.
Sample Input
1
2016420
Sample Output
36295554
Notes
- Use of
long long
or other data types that can store numbers greater than is strongly recommended. - The constraints are set the way they are for a reason! Feel free to sketch out the first two and find the answer by hand.
- For more on what a volleyball looks like, see the Wikipedia article.
Comments
An error was found in the test cases. Submissions will be rejudged.
It's kinda unfair to change the rankings post-contest since most people based their solutions on the incorrect sample input/output during the contest (which is still incorrect). But oh well, unrated, who cares.
Rankings will not be changed, to the best of my knowledge. Sorry about any problems this causes fam