当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7018:Banzhuan

题目描述
Given a three-dimensional space of $[1, n] \times [1, n] \times [1, n]$. You're required to place some $1 \times 1 \times 1$ cubes to make this 3D space look $n \times n$ square from above, from left and from front, while the plane $xOy$ stand for the ground and $z$ axis describes the height.

But placing these cubes must follow some restrictions. Obviously, it must obey the gravity laws. It means, when beneath a cube is empty, the height of this cube will drop one, until its height is exactly $1$ (touch the ground) or there is another cube below it.

And besides that, placing cubes has some prices. If a cube is placed at an integer coordinate $(x, y, z)$, the price will be $x \times y^2 \times z$.

Now, satisfying all the requirements above, you're required to calculate the minimum costs and the maximum costs.
输入解释
The first line contains an integer $T(T \le 15)$. Then $T$ test cases follow.

For each test case, input a single integer $n$ per line, while satisfying $1 \leq n \leq 10^{18}$.
输出解释
For each test case, output two lines. For the first line output the minimum costs $mod\ 10^9 + 7$. And for the second line, output the maximum costs $mod\ 10 ^ 9 + 7$.
输入样例
1
2
输出样例
27
60

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7018

最后修改于 2021-10-23T19:11:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)