luogu#P4881. hby与tkw的基情

hby与tkw的基情

Background

Bromance lasts forever, a pair will be passed down for eternity.

hby and tkw are a pair of close buddies. They often play “games” together (/joking).

Problem Description

They like playing string games, and they especially like palindromes. Each time, hby gives a number nn, and then tkw needs to give $Ans=\sum\limits_{i=1}^ni\times s[i]\times[i\bmod 2]$. Here, s[i]s[i] represents the number of palindromic strings of length ii (only lowercase letters are considered). The last part is a bool expression.

However, recently tkw has been learning from ycz to go find a girlfriend, so he handed this problem to you. If you cannot answer it within 1s1\rm s, then the bromance between hby and tkw will break! (But then tkw can focus on finding a girlfriend.)

Since the answer will be very large, you only need to output the value of the answer mod109+7\bmod 10^9+7.

Input Format

The first line contains an integer TT.

In the next TT lines, each line contains one number nn.

Output Format

There are TT lines in total, each line represents one answer.

2
1
3
26
2054

Hint

For 10%10\% of the testdata, n5n\le 5.

For another 20%20\% of the testdata, n107\sum n\le 10^7.

For another 20%20\% of the testdata, T=1T=1.

For 100%100\% of the testdata, 1T5×1051\le T\le 5\times 10^5, 1n1091\le n\le 10^9.

Translated by ChatGPT 5