5300: I love cube

内存限制:256 MB 时间限制:15.000 S
评测方式:文本比较 命题人:
提交:16 解决:9

题目描述

Give you a cube with a side length of n-1. Find the number of equilateral triangles with three points on the cube point. Each side must be parallel to a certain surface of Oxy, Oxz, Oyz. Now you need to count how many such triangles there are.Each point can only be on the boundary or inner point of the cube, and the three coordinates x, y, and z of each point must be integers.

输入

The first line contains an integer T(T<=1e5) . Then T test cases follow.

Each test case contains a single Integer n(0<=n<=1e18).

If n=0, output 0

输出

For each case, print an integer, which is the answer modulo 109+7

样例输入 复制

2
1
2

样例输出 复制

0
8