Array Challenge

TimeLimit:1000MS  MemoryLimit:153428KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
There’s an array that is generated by following rule.
$h_0=2,h_1=3,h_2=6,h_n=4h_{n-1}+17h_{n-2}-12h_{n-3}-16$
And let us define two arrays ${b_n} and {a_n}$ as below.
$b_n=3h_{n+1} h_n+9h_{n+1} h_{n-1}+9h_n^2+27h_n h_{n-1}-18h_{n+1}-126h_n-81h_{n-1}+192(n>0)$
$a_n=b_n+4^n$
Now, you have to print $\left \lfloor √(a_n ) \right \rfloor $ , n>1.
Your answer could be very large so print the answer modular 1000000007.
Input
The first line of input contains T (1 <= T <= 1000) , the number of test cases.
Each test case contains one integer n (1 < n <= $10^{15}$) in one line.
Output
For each test case print &#8970;√(a_n )&#8971; modular 1000000007.
SampleInput
3
4
7
9
SampleOutput
1255
324725
13185773
Submit
题目统计信息详细
总AC数4
通过人数4
尝试人数4
总提交量4
AC率100.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: