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 , and then tkw needs to give $Ans=\sum\limits_{i=1}^ni\times s[i]\times[i\bmod 2]$. Here, represents the number of palindromic strings of length (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 , 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 .
Input Format
The first line contains an integer .
In the next lines, each line contains one number .
Output Format
There are lines in total, each line represents one answer.
2
1
3
26
2054
Hint
For of the testdata, .
For another of the testdata, .
For another of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5