Home Web Board ProblemSet Standing Status Statistics
long long输出请使用 %lld服务器的python版本为3.4
Problem H: 六队-某简单的数列

Problem H: 六队-某简单的数列

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 101  Solved: 28
[Submit][Status][Web Board]

Description


F[n+1]=F[n]+n^2

S[n]=F[1]+F[2]+……+F[n]

已知F[0]与n求S[n]

对1e9+7取模

Input

数据组数T

接下来T行F[0] n

0<F[0],N<=1e8

Output

TS[n] mod 1e9+7

Sample Input

1
2 5

Sample Output

60

HINT

[Submit][Status][Web Board]