TSOC '16 Contest 2 #6 - Hinata and Volleyball Graph

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
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 k. 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 2–graph, how many edges is that even? 1, 2, … And what if I considered T such k–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 T volleyballs, each with a given number of panels per section k, the number of total edges there are in the corresponding graph of the volleyball as defined above.

Constraints

Subtask 1 [10%]

T = 1, k = 1

Subtask 2 [10%]

T = 1, k = 2

Subtask 3 [80%]

T \le 10^5, 1 \le k \le 10^9

Input Specification

First line: T, the number of test cases.

Next T lines: An integer k.

Output Specification

T lines of output, each with a single integer: The number of edges in the specified k–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 10^9 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


  • 0
    bobhob314  commented on April 26, 2016, 1:24 a.m.

    An error was found in the test cases. Submissions will be rejudged.


    • 6
      r3mark  commented on April 26, 2016, 3:33 a.m.

      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.


      • 2
        bobhob314  commented on April 26, 2016, 11:17 a.m.

        Rankings will not be changed, to the best of my knowledge. Sorry about any problems this causes fam